d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Help W/ Basic Java Assignment
Add Reply New Topic New Poll
Member
Posts: 2
Joined: Sep 6 2018
Gold: 0.00
Sep 6 2018 10:51am
Hi, I need help with a basic java assessment. The instructions are:

Create a program that reads solar energy production data for the last week from a file, gets
input for the cost of the system, and outputs production, savings, days to recoup cost and
years to recoup the cost.

Program should read in a file called “energyProduced.txt”. The contents of the file are
at the bottom of the requirements. The file should be a normal text file with no
special formatting. The file should be in the same directory as the program.
• Use a named constant for the cost of electricity at .085.
• Read in all data from the file. (refer to pages 102-103)
o Get input from the file and store production values for each in doubles.
• Get input for “Total system cost” in dollars and stored as an integer. Get input
on same line as prompt, see example.
• Output the following items per the sample below:
• Total Energy Produced in one week.
• Total Savings for one week (total production times cost for electricity)
• Total Savings per day (the average)
• Days to recoup the system cost (truncated)
o Use typecasting to integer to get rounded value
• Years to recoup the system cost (truncated)
o Use typecasting to integer to get rounded value
• Ensure columns are aligned, use escape characters to align columns.

Data for Text File (name it energyProduced.txt)
70.3
72.2
71.6
70.5
69.0
72.2
72.6
Member
Posts: 1,039
Joined: Jul 8 2008
Gold: 1,939.50
Sep 6 2018 03:51pm
How much FG to do your homework? I see you have 2 comments, 0 fg, and joined today so I'm not too keen on doing this for free.

Did you try reading pages 102-103? I'd start there.
Member
Posts: 1,039
Joined: Jul 8 2008
Gold: 1,939.50
Sep 6 2018 03:54pm
Perhaps ask a question instead of just "do my entire project for me"?
Member
Posts: 11,273
Joined: Apr 26 2008
Gold: 3,303.50
Sep 6 2018 04:48pm
What do you need help with? ^^
Member
Posts: 2,957
Joined: Aug 29 2011
Gold: 0.00
Oct 1 2018 05:19pm
I just had this same exact homework for a c++ project but obviously a different file/variables... Super simple program. Where is your code and where are you stuck?

At least do most the project/what you're able to otherwise wtf are you doing paying for school. A degree is just a piece of paper. The skills you learn and struggle learning in school is the only reason you should be in school
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll