You have been contacted by a science teacher to design a console application for his students to calculate the potential and kinetic energy of an object.
The program should prompt the user to enter 1 to calculate the potential energy and 2 to calculate the kinetic energy.
For potential energy, prompt the user to enter the mass and height of the object.
For kinetic energy, prompt the user to enter the mass and velocity of the object.
If user enters an invalid option, the program should continue asking for a valid option until a valid one is entered.
The user should enter 1 to continue using the application or 0 to exit.
Following the software development process, answer the following questions:
(a)
Write an algorithm for the application.
(b)
Draw a flowchart for the algorithm.
(c)
Write a pseudocode for the algorithm.
(d)
Implement the application.
Potential Energy = mass x gravity x height
Gravity = 9.81 m/s²
Kinetic Energy = 0.5 x mass x velocity²
The Akans in Ghana name their children based on the gender and the day of the week they were born.
As an initiative to preserve this cultural tradition, you have been asked to create a simple C program that can determine the appropriate name for a child based on these criteria.
Your program should prompt the user to enter 1 for male and 2 for female
Your program should continue prompting until a valid gender option is entered.
Then prompt the user to enter the day of the week they were born:
1. Monday
2. Tuesday
3. Wednesday
4. Thursday
5. Friday
6. Saturday
7. Sunday
Your program should continue prompting until a valid day option is entered.
Finally, your program should output the appropriate Akan name based on the user's input.
The program should ask a user to enter 1 to continue or 0 to exit.
Using the software development process, answer the following questions:
(a)
Write the algorithm for the program.
(b)
Draw the flowchart for the algorithm.
(c)
Write a pseudocode for the algorithm.
(d)
Implement the program.