hello,
in january i will be starting a computer science class using
java. i went ahead and got the book so i could start practicing and hopefully stay on top of everything. i have come across a project that i just cant seem to figure out. i have got the first part accomplished but i am not doing something right with the numbers in the next part.
i put 2 hours of tv a day on the first part so that would be 7300 hours , 304.16666666666666666666666666667 days , or 0.83333333333333333333333333333334 years watching tv! i cant figure out how i am suppose to enter it, and doing something wrong with the tab and spacing.
also under the to do list it says to write a pseudocode algorithm for this and to write your program one step at a time. doesnt this mean the same thing?
any help would be appriciated!
sorry for adding all this to email but it wouldn't let me attach anything
chris
You should be able to:
• Use sequential logic to write an algorithm
• Create a simple class to do some input from the keyboard, output and simple calculations
• Declare and define identifiers of primitive types
• Use constant identifiers where appropriate
• Request and process input from the keyboard
• Perform basic mathematical operations
• Display output to the monitor
The Project
Develop a simple program in Java that will interact with the user through some dialog. It will ask the user for his/her name and the number of hours that the watches TV per day (on average). The program will then display to the user the approximate number of hours and the equivalent number of days and the equivalent number of years that the user will have spent watching TV over the next 10 year
Notes:
• The average hours of TV watched per day can have a decimal place when entered (ex, 2.5 or 5.3 or 6)
• The output should look exactly like that shown in the examples (pay close attention to line breaks and spacing)
• You can make the following assumptions: there are 24 hours in a day, 365 days in a year. This program does not account for leap years. Obviously, using 365 days in a year is not totally accurate, but it makes the solution to this problem much simpler
• Since there are always 24 hours in a day and 365 days in a year (for this program, anyway) you should make these constant values
• This program should be designed such that the number 10 years can easily be changed by the programmer in one place rather than throughout the program
PROJECT TO DO LIST:
Write a pseudocode algorithm for this project
Test your algorithm before coding
Create a class called Project1 containing a method called main (which contains the code to implement this project). Your project should be saved in a folder named LastnameFirstnameProject1 (replace Lastname and Firstname with your own last and first name)
Write your program one step at a time, i.e. make sure one thing works before going on to something else. For instance, write the part that asks for the users name and says hello back to the user (and test it to make sure that it works) before writing the rest of the code
Test your program to make sure that it works!
Complete the documentation of the application by inserting comments and adhering to programming standards