Fetch Data From Google Sheet

let offset = 'A2';
let limit = 'Z999';
const sheetid = "<sheetid>"; 

const apikey = "<api key>"; 

const sheetname = "Sheet1";
const url = `https://sheets.googleapis.com/v4/spreadsheets/${sheetid}/values/${sheetname}!${offset}:${limit}?key=${apikey}`;

var sheet_data = [];

fetch(url).then(data => data.json()).then(data => { 
	sheet_data = data.values;
	console.table(sheet_data);
});
  • https://docs.google.com/spreadsheets/d/sheetid/edit?usp=sharing
  • create/get apikey from https://console.developers.google.com/apis/credentials

Assignment

===========================================================================
Week 1 Assignment
===========================================================================

  1. WAP to read radius of circle and calculate Area and Circumference
  2. WAP to read 3 numbers and find their mean
  3. WAP to read 2 numbers and find Sum of their last digit
  4. WAP to read 4 digit number and sum of its digits
  5. WAP to read radius of Sphere and find its Volume
  6. WAP to read 3 digit number and sum of its digit
  7. WAP to read 4 digit number and find reverse of that number
  8. WAP to read temperature in degree Celsius and convert it into Fahrenheit
  9. WAP to read value in inches and print it in feet and inches
  10. WAP to read marks of 5 subjects and print total and percentage
  11. Create radio button
    red blue yellow green
    on change of radio button change background color of body
  12. Create 2 select box and move items from left to right and vice versa
  13. Create 3 select box country state city
  • on change of country load states
  • on change of state load cities

Programs on If Statement

SWITCH Statement

===========================================================================
Week 2 Assignment
===========================================================================

Loops Programs

Arrays Programs (One Dimensional)

Arrays Programs (Multi Dimensional)

JSON

  1. Create JSON Object with following information
    Roll Number, Name, Age, Sex
    EmpNo, Name, Job, Sal
    Name, Wages, WorkingDays
  2. WAP to create array of 5 json objects worker and display average payment
    object parameter: name,wages,working_days
  3. WAP to create array of 5 json objects student and print all student records who has greater than average marks
    roll_no, name, marks

AJAX (fetch API)

  1. WAS to make AJAX call for following operations
    1. Input a number in text box and get square of that number from php script
    2. Input 2 numbers in text box and get addition of two numbers from php script
    3. Input radius in text box and find area and circumference of circle from php script
    4. Input length and breadth in text box and find area of rectangle from php script
    5. Input a number in text box and find factorial of number from php script
  2. WAP to print users data in html table by making ajax call to
    • https://jsonplaceholder.typicode.com/users
    • https://reqres.in/api/users (should have column to display thumbnail of user avatar)

===========================================================================
Week 3 Assignment
===========================================================================

  1. Design a class Rectangle
    • data members:
      1.  length
      2. breadth
    • member function / method: 
      1. setDimension()
      2. area()
      3. perimeter()
  2. Design a class Worker
    • data members:
      1. wages
      2. wdays
    • member function / method:
      1. setData()
      2. payment()
  3. Design a class Box
    • data members:
      1. length
      2. breadth
      3. height
    • member functions / methods:
      1. setDimension()
      2. volume()
  4. Design a class Rectangle
    • data members:
      1. length
      2. breadth
    • member functions / methods:
      1. setDimension()
      2. area()
      3. perimeter()
  5. Design a class Box
    • data members:
      1. length
      2. breadth
      3. height
    • member functions / methods:
      1. volume()
  6. Design a class Account
    • data members:
      1. account_number
      2. balance
    • member functions / methods:
      1. deposit()
      2. withdraw()
      3. showBalance()
  7. Design a class Set
    • data members:
      1. 3 numbers
    • member functions / methods:
      1. SUM()
      2. MEAN()
      3. MAX()
      4. MIN()
  8. Design a class Student
    • data members:
      1. roll_number
      2. name
    • member functions / methods:
      1. setData()
      2. getData()
  9. Design a class Account
    • data members:
      1. account_number
      2. balance
      3. interest_rate
        NOTE: interest_rate must be shared by all objects and its default value 10.25
    • member function:
      1. interest(no_of_years)
  10. Design a class Student
    • data members:
      1. roll_number
      2. name
    • member functions / methods:
      1. setData()
      2. getData()
        NOTE: roll_number must be automatically generated.It also keep track of total number of Students.
  11. Design a class Student
    • data members:
      1. roll_number
      2. name
    • member functions / methods:
      1. getData()
      2. showData()
        Create Array of 5 Student objects
  12. Create array of Student Objects
    • data members:
      1. roll_no
      2. name
      3. college
    • member functions / methods:
      1. readData()
      2. showData()
  13. Create a class RBI
    • data members:
      1. account_number
      2. balance
    • member functions / methods:
      1. deposit(int amt)
      2. withdraw(int amt)
      3. showBalance()

Fun with JS CSS and HTML

  1. Create radio button red blue yellow green on change of radio button change background color of body
  2. Create 2 select box and move items from left to right and vice versa
  3. Create 3 select box country state city a) on change of country load states b) on change of state load cities
    NOTE: Use AJAX call and fetch country states and cities from mysql database
  4. Create tic-tac-toe game.
    1. single player with computer
    2. multiplayer with manual event

Loops Programs

  1. WAP to read a number and print all numbers from 1 to that number
    input: enter a number: 5
    output:
    1
    2
    3
    4
    5
  2. WAP to read number and print all even numbers from 1 to that number
    input: enter a number: 5
    output:
    2
    4
  3. WAP to print all number from 1 to 10 by using while, for and do -while loop.
  4. WAP to read a number and find sum of all numbers from 1 to that number
    input: enter a number: 5
    output: 1 + 2 + 3 + 4 + 5 = 15
  5. WAP to read a number and find factorial of that number
    input: enter a number: 5
    output: 1 * 2 * 3 * 4 * 5 = 120
  6. WAP to read a number and find reverse of that number
    input: enter a number: 1234
    output: 4321
  7. WAP to read a number and check if it is a prime number or not
    input: enter a number: 5
    output: 5 is a prime number
  8. WAP to print all prime number in range from 1 to 100
    output: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97
  9. WAP to print first 10 fibonacci number
    output: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55
  10. WAP to read a number and find sum of its digits
    input: 12345
    output: 1 + 2 + 3 + 4 + 5 = 15
  11. WAP to find a 3 digit armstrong number
    output: 153
  12. WAP to print all armstrong numbers from 1 to 999
    output: 153, 370, 371, 407
  13. WAP to print ASCII chars and values from 1 to 255
  14. WAP to print alphabets from A to Z using loop
  15. WAP to read a number and count all numbers which divides the given number perfectly
  16. WAP to read 2 numbers and print their common factors
  17. WAP to read 2 numbers and print HCF
  18. WAP to print factorial of all numbers from 1 to 10
  19. WAP to read 2 numbers a and b and print all numbers from a to b
  20. WAP to repeatedly read a number until it is in range from 10 to 20
  21. WAP to read a number and print all numbers which divides the given number perfectly
  22. WAP to find sum of series
    S = 1 + 2 + 3 + …. + N
  23. WAP to find sum of series
    S = 1 + 2! + 3! + …. N!
  24. WAP to find sum of series
    S = 1 + 1/2 + 1/3 + 1/4 + 1/5 + …. + 1/N
  25. WAP to find sum of series
    S = 1 – 1/2 + 1/3 – 1/4 + 1/5 – …. 1/N
  26. WAP to read a number and print tables from 1 to that number
  27. WAP to print following output
    • 12345
      1234
      123
      12
      1
    • 54321
      4321
      321
      21
      1
    • *****
      ****
      ***
      **
      *
    • 1234554321
      1234554321
      1234554321
      1234554321
      1234554321
    • 12345123451234512345
      12345123451234512345
      12345123451234512345
    • ABCDE
      ABCD
      ABC
      AB
      A
    • ABCDEFEDCBA
      ABCDE EDCBA
      ABCD   DCBA
      ABC     CBA
      AB       BA
      A         A
    • *********
      *******
      *****
      ***
      *
  28. WAP to print table of number in following format using 1 for loop
    input: enter a number: 5
    5 * 1 = 5 5 * 10 = 50
    5 * 2 = 10 5 * 9 = 45
    5 * 3 = 15 5 * 8 = 40
    5 * 4 = 20 5 * 7 = 35
    5 * 5 = 25 5 * 6 = 30
    5 * 6 = 30 5 * 5 = 25
    5 * 7 = 35 5 * 4 = 20
    5 * 8 = 40 5 * 3 = 15
    5 * 9 = 45 5 * 2 = 10
    5 * 10 = 50 5 * 1 = 5

Programs on If Statement

  1. WAP to read a number and check if it is even or odd
    input:
    Enter a number: 5
    output: number 5 is odd
  2. WAP to read 2 numbers and check if their last digits are same or not
    input:
    Enter number 1: 55
    Enter number 2: 45
    output: Last digits of 55 and 45 are same
  3. WAP to read 3 angles and check if triangle can be formed or not
    input:
    Enter value for angle a: 50
    Enter value for angle b: 60
    Enter value for angle c: 70
    output: Triangle can be formed
  4. WAP to read 3 angles and check if it is and equilateral triangle or not
    input:
    Enter value for angle a: 60
    Enter value for angle b: 60
    Enter value for angle c: 60
    output: Triangle is equilateral triangle
  5. WAP to read marks for 5 subjects and check if student is passed or not
    input:
    Enter marks for maths: 50
    Enter marks for science: 50
    Enter marks for history: 50
    Enter marks for english: 50
    Enter marks for marathi: 50
    output:
    Total Marks: 250
    Percentage: 50%
    Student is passed
  6. WAP to read 2 numbers and find the greatest of them
    input:
    Enter number 1: 50
    Enter number 2: 60
    output:
    60 is greater than 50
  7. WAP to read 3 numbers and find the greatest of them
    input:
    Enter number 1: 50
    Enter number 2: 60
    Enter number 2: 70
    output:
    70 is greater than 50 and 60
  8. WAP to read 3 digit number and check if the sum of cube of its digits is equal to that number or not
    input:
    Enter a 3 digit number: 153
    output:
    Success: Sum of cube of 153 is 153
  9. WAP to read 3 numbers and check their last digit is same or not
    input:
    Enter number 1: 50
    Enter number 2: 60
    Enter number 3: 70
    output:
    Last digits of 50, 60 and 70 are same
  10. WAP to read a number and check if it is palindrome number or not
    input:
    Enter a number: 121
    output:
    121 is palindrome number
  11. WAP to read marks of 5 subjects and print their total. Also print percentage and check if student is passed or not
    input:
    Enter marks for maths: 50
    Enter marks for science: 50
    Enter marks for history: 50
    Enter marks for english: 50
    Enter marks for marathi: 50
    output:
    Total Marks: 250
    Percentage: 50%
    Student is passed
  12. WAP to read 3 angles and check if triangle can be formed or not. If triangle can be formed then check it it is equilateral, isosceles or right angled triangle
    input:
    Enter value for angle a: 45
    Enter value for angle b: 45
    Enter value for angle c: 90
    output:
    Triangle can be formed
    The triangle is right angled triangle
  13. WAP to read age and gender of person and check if person is Eligible for marriage or not
    input:
    Enter gender M or F: M
    Enter your age: 30
    output:
    30 ka ho gaya ab to shadi kar le
  14. WAP to read a year and check if it is Leap year or not
    input:
    Enter year: 2004
    output:
    Year 2004 is a leap year
  15. WAP to read a Salary of Employee and print commission according to following Criteria
    SAL               Commission
    <10000             10%
    10000-20000   12%
    >20000             15%
    input:
    Enter Salary: 10000
    output:
    Your commission is 1000 Rupees
  16. WAP to read percentage of student and print Division
    >=75 : 1st class with distinction
    60-75: 1st class
    50-60: 2nd class
    40-50: 3rd class
    <40: fail
    input:
    Enter marks for maths: 75
    Enter marks for science: 75
    Enter marks for history: 75
    Enter marks for english: 75
    Enter marks for marathi: 75
    output:
    Total Marks: 375
    Percentage: 75%
    Student passed with 1st class Distinction