Gå til innhold

C++ skole problem


Anbefalte innlegg

jeg har et lite problem på skolen så skal jeg vistnokk greie å lage noe ut av denne problem stillingen

 

You have just been given the task to completely redesign and write the customer billing program at E-Z Watt Electric Co-Op. Design the algorithm and program solution that will read a file containing the amount of electricity that each customer uses on a monthly basis. The files consist of:

 

A. an account summary record, which provides the total kilowatt-hours used during the previous month by a customer, the amount owed, and the amount paid; and

 

B. a monthly reading detail record, which contains the customer number, meter number, and the electricity usage (in kilowatt-hours) for the month.

 

The program will read the electricity usage file and produce a billing report showing the customer number, name, electricity, and the amount owed. The amount owed is calculated at 11 cents for each kilowatt-hour used up to 200 hours, and 8 cents for each kilowatt-hour used over 200 hours. The total electricity usage in kilowatt-hours is also to be accumulated and printed.

At the end of each customer bill, compare the total electricity usage accumulated in the program with the value provided in the header record and print an appropriate message if the totals are not equal.

 

noen som har en idee om hvorden jeg skal gå frem på dette,

 

mine problemer er

 

1 hvordan skal jeg lage en algoritme som kan forandre seg etter jeg har brukt 200 timer

Endret av Lucifer89
Lenke til kommentar
Videoannonse
Annonse
1 hvordan skal jeg lage en algoritme som kan forandre seg etter jeg har brukt 200 timer

 

Du tar med sjekken for 200 i algoritmen - altså du gjør en sjekk og splitter om unntaket gjelder:

 

if(something < 200)
 doSomething();
else
 doSomethingElse();

 

2. hvordan får jeg inn slik at programmet sammenligner denne måneds regning med forgje måned

7107136[/snapback]

 

Hum .. åssen forventer du at en annen skal svare på dette i denne sammenhengen?

Endret av lnostdal
Lenke til kommentar

Opprett en konto eller logg inn for å kommentere

Du må være et medlem for å kunne skrive en kommentar

Opprett konto

Det er enkelt å melde seg inn for å starte en ny konto!

Start en konto

Logg inn

Har du allerede en konto? Logg inn her.

Logg inn nå
×
×
  • Opprett ny...