THEME: Doing Calculations
Implement three different small programs which deal with calculations.Program no1: this program calculates the distance of lightning.Program no2: this program converts Celcius to Fahrenheit and vice versa.Program no3: this program calculates the age of a person.
Use the double datatype to calculate the distance. Sound travels one kilometer every three seconds. In order to calculate the distance, just divide the number of seconds by three.
This is a classic program and maybe you have already done this in C. See how you can re-use your code from the previous module. If this a new program, then figure out what datatypes you should use. Let the user decide if he what temperature type he wants to calculate.
Let the user enter his birthday (day, month, year) and convert this input into a suitable date object. Now calculate the exact age with the current time.
Using the correct datatypes for the calculations. Using the correct date type to calculate the age.
These mini programs can be combined into one larger program. How do you integrate this in your main-method? Instead of using primitive types like int or double, use the corresponding Wrapper classes and therefore work with objects. What changes? What is different? Note down your findings and explain this to your teacher.
Write each program separately in own classes. Each program has its own main-method.