Question: 1. Which data type would most appropriately be used to represent the following data values? (10%) (1) The number of months in a year (2)

 1. Which data type would most appropriately be used to represent
the following data values? (10%) (1) The number of months in a

1. Which data type would most appropriately be used to represent the following data values? (10%) (1) The number of months in a year (2) The area of a circle (3) The current minimum wage per hour (4) The distance between earth and Vega, approximately 147,000,000,000,000 miles (5) Your full name Which of the following lines are not legal expressions? (15%) (1) 4x 10 + 2 (2) 3 * 7+1 (3) 2+ (4) 42 (5) 2+2 3. Given the expression: 30 - 3** 2 + 6 // 3** 2 - 10 (1) Show the order of precedence as Page 33 of Lecture 6. (10%) (2) What is the output of the expression? (5%) 4. Find the three compile-time errors in the following program. (15%) int x = 2 print (x, squared is, x-x) xcubed = x **3 Part II - Programming questions 5. Write a program to print the word "Hello" vertically. (15%) 6. Write a program to ask the user to enter the a axis and b axis of an ellipse, then compute and display the area. The formula is: A = mab, where = 3.14159 You may assume that the user always enters two positive decimal numbers. (30%)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!