Lab Assignment 3

  1. Several countries measure temperature using the Celsius scale. But some others do using the Fahrenheit scale. Search online for the relationships between the two. Write a program to (a) check from the user whether they would like to enter the temperature in Celsius or Fahrenheit (b) the value of the temperature in the descired scale. Depending on what they enter, convert it to the other scale e.g., if they enter in Celsius, convert to Fahrenheit and vice-versa, and output the converted temperature on the screen in the changed unit.
  2. Write a program to input the following details of a person (a) Full Name (b) Address (c) Mobile Number (d) Email. You should do it in a user friendly manner. Then, output them on the screen with one field on each line.
  3. Write a program to input an year from the user. Write a program to check whether year is leap or not. Recall that an year is a leap year if (a) it is divisible by 4 AND (b) if it is mulitple of 100 then it is also a multiple of 400. You should do it using nested if/else constructs. In particular, your program should not use any logical operators (i.e., &&, ||, !).
  4. Sakshi likes to play tennis on weekends based on the weather condition. She makes her decision depending on the following three factors. She decides to play tennis if (a) Outlook is overcast OR (b) Outlook is rainy and Wind is weak OR (c) Outlook is sunny and Humidity is normal. Write a program which would take as input current weather condition i.e. Outlook, Wind and Humidity, and output yes/no depending on whether Sakshi would like to play tennis in these weather conditions.