Processing Assignment 2
Using Variables & Math Functions
Directions:
- All students are to do question 1 and then complete the level of assignment for the second question. Grade increases based on difficulty level.
- A flow chart is to accompany each program. Use a flowcharting template (5 marks)
- Submit your assignment on MS teams. include the source code in .pde format and scan/image of the flowchart
1. You are an intern at a radio station. The disk jockeys announce the temperature in both Fahrenheit and Celsius every half hour. They would like an easy way to display both the Fahrenheit and Celsius temperatures quickly and at the same time. The local airport phones in the temperature (but only in Celsius). They have requested that you develop an application that will display both temperatures after the Celsius temperature is inputted. Note: Use this conversion formula F= (C * 1.8) + 32 . Please use the Ask function for input. Output the Fahrenheit and Celsius temperatures in a table.
1. You are an intern at a radio station. The disk jockeys announce the temperature in both Fahrenheit and Celsius every half hour. They would like an easy way to display both the Fahrenheit and Celsius temperatures quickly and at the same time. The local airport phones in the temperature (but only in Celsius). They have requested that you develop an application that will display both temperatures after the Celsius temperature is inputted. Note: Use this conversion formula F= (C * 1.8) + 32 . Please use the Ask function for input. Output the Fahrenheit and Celsius temperatures in a table.
Bonze Level: Demonstrate a basic understanding (Max marks: 7)
2. A driver’s education class does time trial out in the parking lot. However, they use an old stopwatch that holds the time in seconds. Write a program which inputs (using the Ask function) the number of seconds as a whole number, then converts that value to hours, minutes and seconds, for example an input of 3669 seconds results in the following output:
Silver Level: Demonstrate a good understanding (Max marks 8)
3. A fast food restaurant charges $1.49 for burgers, $0.89 for fries, and $0.99 for sodas. You have been commissioned to write a cash program which allows an employee to enter an order (the number of burgers, fries and sodas), the amount of cash the customer spent, and then display itemized list of purchased items, subtotal, the tax (13%) and the final cost and the change.
Gold Level: Demonstrate expert understanding (Max 10 marks)
4. One of the equations of motion in physics is Vf2 = Vi2 + 2ad where Vf is the final velocity of an object (m/s), Vi is its initial velocity (m/s), a is its acceleration (m/s2) and d is the distance it travels (m). So this formula allows you to calculate how fast an object is going at an ending point if you know what speed it began at, the distance from the starting to the ending point and the (constant) acceleration from the starting point to the ending point. Use this formula to compute the final velocity of an object given the other three values. Have your program prompt, using the Ask function, the user to input the initial velocity Vi, the acceleration a, and the distance d as decimal numbers (hint: doubles). The program will then calculate and output the final velocity Vf.