Question: Assignment 1 1. Write a program to implement the following formula for a -10 and b = 4; result = (a + 2b -

Assignment 1 1. Write a program to implement the following formula for

Assignment 1 1. Write a program to implement the following formula for a -10 and b = 4; result = (a + 2b - 4ab)^4 // ^4 means to the power of 4 (1 mark) 2. Write a program to implement result = sin (PI / 3) * tan (PI / Use the double data type. 4) (1 mark) 3. Write a program to count the sum of integers from 10 to 20. Use a for loop. (1 mark) 4. Do question 3 using a while loop. (1 mark) 5. Write a program to find the sum of all odd integers starting from 11 to 21, inclusive. Your program should count 11 +13 + 15 + (2 marks) + 21. 6. Do question 5 using even numbers from 10 to 20. (2 marks) 7. Find the volume of a cylinder with radius 2 and height of 4. Remember that V = PI rr height () (4 marks) 8. Imagine you work 8 hours from Monday to Thursday, 6 hours on Friday, 4 hours on Saturday, and you are off on Sunday. Write a program to accept the day index as an integer from the user and display the hours. In a while loop continuously ask the user and display the hours worked. Terminate the program when the user enters an index outside 0-6. Use a switch statement; do not use an if-else structure. Here is an example of how a user interacts with your program: Program: Please enter a day index. Use 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. User : 2 Program: You work 8 hours on Tuesdays. Program: Please enter a day index. Use 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on. User : -1 Program: Program terminating. (8 marks)

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 Programming Questions!