a program

Budgetrahmen
< 100 EUR
Ende der Angebotsphase
Angebotsphase abgeschlossen
Notwendige Expertise
Web & Programmierung, C++
Kunde
ken***  - Süd-Georgia und die südlichen Sandwich-Inseln
Beschreibung

 

PROBLEM#: 1

A parking garage charges a R7.00 minimum fee to park for up to three hours. The   garage charges an additional R1.75 per hour or part thereof in excess of three hours. Assume that no car parks for longer than 24 hours at a time. To determine how long a car was parked, both the entry time and exit time are converted to minutes. The entrance time in minutes is then subtracted from the exit time in minutes, and these minutes are converted back to hours and minutes before the parking fee is calculated.

Write a program that calculates and prints the parking charges for customers who parked in this garage. Twenty customers use the parking garage at any given time. For each customer the program has to:

·        Input the time when the parking garage was entered

·        Input the time when it was exited

·        Convert both the entry and exit time  to minutes

·        Calculate how long the car was parked in minutes (parked time)

·        Convert the parked time in minutes back to time in hours and minutes

·        Calculate the charge (amount owed by the customer)

·        Display the receipt for the customer (display entry and exit times (in 24h00 format, duration for parked time and charge

·        Calculate the total of daily receipts

·        Finally the total amount of all the receipts should be displayed with informative messages

The program should consist of five functions. Declare constants for the number of minutes in an hour, the minimum fee (R7.00), the cut-off time of three hours, the hourly fee of R1.75 and the number of customers (20). Follow the conventions of the Study Guide and prescribed text when writing the program.

Main function()

      Declare the following variables:        

                  entranceHour, entranceMinutes

                  exitHour, exitMinutes

                  entranceTimeInMins, exitTimeInMins, minutesParked;

                  parkedHours, parkedMinutes;

                  charge, totalCharges;

Use a for loop going from 1 to the number of customers. The other four functions should be called inside the for loop

        Function InputAndValidate()

This function inputs the time. The time should be entered as two separate values for the hours and minutes e.g. the customer enters the parking garage at 9h30, the time should be entered as 9 for the hour and 30 for the minutes. Do not accept a value less than 0 or more than 24 for the hour, or a value of less than 0 or more than 59 for the minutes. If this happens a prompting message should be displayed and the values entered repeatedly until they are valid. If a value of 24 has been input for the hour, the minutes should be made 0, regardless of what value the user has entered for the minutes. You have to decide yourself on the type of function and the number of type(s) of the parameters

     Function convertToMinutes()

This function converts the time given in hours and minutes to time in minutes, e.g. 9h30 is converted to 570 minutes. You have to decide yourself on the type of function and the number and type(s) of the parameter(s)

    Function convertBackToTime()

This function converts the time given in minutes to time in hours and minutes, e.g. 570 minutes is converted to 9h30. You have to decide the type of function and the number and type(s) of parameter(s).

Hint: Use the operators / and % to calculate the number of hours and minutes from the total number of minutes

     Function calcCharge()

This function calculates the amount due based on the parked time in hours and minutes. Again you have to decide yourself on the type of function and the number of type(s) of the parameter(s)

Run your program on the data below. The first two values in a row represent the hours and minutes of the entry time and the last two values represent the hours and minutes of the exit time.

Submit the printouts of the program and output together with the USB

9 30             13 23

8 00             12 59

10 12           13 13

10 00           12 12

7 01             17 14

-5 65           10 60

6 18             16 33

14 15           16 04

13 11           17 45

11 27           24 55

8 55             25 61

8 55             15 47

Projekttyp Festpreis
Vertraulichkeit Meine Projektausschreibung soll für alle Besucher von twago und in Suchmaschinen (z.B. Google) sichtbar sein.
Implementation 26.08.2011 - 28.08.2011
Ausschreibungsdetails Die Angebote sollen lediglich für mich sichtbar sein.
Alle Fragen und Antworten  9 Personen folgen dem Projekt
Sie haben Fragen zum Projekt? Stellen Sie hier Ihre Fragen. Der Kunde antwortet hier ebenfalls, um allen die gleichen Informationen zu geben. Bitte geben Sie hier keine Kontaktdaten an. Inhalte, bei denen es nicht um Projektdetails geht, werden gelöscht. Sie möchten den Kunden direkt anschreiben? Bitte geben Sie zuerst Ihr Angebot ab. Ihr Angebot ist unverbindlich und jederzeit aktualisierbar. Anschließend können Sie mit dem Kunden persönlich kommunizieren.
Vor ca. einer Minute
Vor ca. einer Minute
Vor {0} Minute
Vor {0} Minuten
Vor {0} Stunde
Vor {0} Stunden
Vor {0} Tag
Vor {0} Tagen
Vor {0} Woche
Vor {0} Wochen
Vor {0} Monat
Vor {0} Monaten
Vor {0} Jahr
Vor {0} Jahren
[ausgeblendet]
Verifizierter Nutzer Nutzerverifikation

twago verifiziert Ihr Nutzerkonto. Zeigen Sie Geschäftspartnern, dass Ihr Profil geprüft ist. Verifizierten Nutzern wird ein höheres Vertrauen entgegen gebracht.
Medium Medium Mitglied

Unsere Medium Mitgliedschaft erfüllt die Bedürfnisse kleiner Unternehmen. Mit einer Medium Mitgliedschaft erhöhen Sie Ihre Chancen für ein Projekt ausgewählt zu werden. Upgraden Sie Ihren Account noch heute und arbeiten Sie demnächst noch erfolgreicher mit twago.
Premium Premium Mitglied

Unsere Premium Mitgliedschaft erfüllt die Bedürfnisse professioneller Unternehmen. Mit einer Premium Mitgliedschaft erhöhen Sie Ihre Chancen für ein Projekt ausgewählt zu werden. Upgraden Sie Ihren Account noch heute und arbeiten Sie demnächst noch erfolgreicher mit twago.
Freelancer Freelancer Mitglied

Unsere Freelancer Mitgliedschaft erfüllt die Bedürfnisse kleiner Unternehmen oder erfolgreicher Selbständiger. Mit einer Freelancer Mitgliedschaft erhöhen Sie Ihre Chancen für ein Projekt ausgewählt zu werden. Upgraden Sie Ihren Account noch heute und arbeiten Sie demnächst noch erfolgreicher mit twago.
Premium Premium Mitglied

Unsere Premium Mitgliedschaft ist speziell für unsere anspruchsvollen Kunden konzipiert. Mit einer Premium Mitgliedschaft erhöhen Sie Ihre Chancen für ein Projekt ausgewählt zu werden. Außerdem werden Sie in unserem Branchenbuch (directSearch) gelistet und unsere Nutzer können Sie direkt kontaktieren. Upgraden Sie Ihren Account noch heute und arbeiten Sie demnächst noch erfolgreicher mit twago.
VIP VIP Mitglied

Unsere VIP-Mitgliedschaft ist speziell für unsere besten Service-Anbieter konzipiert. Mit einer VIP-Mitgliedschaft erhöhen Sie Ihre Chancen für ein Projekt ausgewählt zu werden. Außerdem listen wir Sie in unserem Branchenbuch (directSearch). Upgraden Sie Ihren Account noch heute und arbeiten Sie demnächst noch erfolgreicher mit twago.
Verifizierte Referenz Referenzverifikation

twago verifiziert Ihre Referenzen und zeigt so Ihren Kunden das diese korrekt sind. Service-Anbieter mit verifizierten Referenzen haben eine signifikant höhere Chance für ein Projekt ausgewählt zu werden.
twago Nutzer
Vor 9 Monaten
Is C++ mandatory ?
Angebote und Service-Anbieter

Die Angebote sind nur für registrierte Nutzer sichtbar. Registrieren Sie sich oder loggen Sie sich ein, um mehr Details zu sehen.

Sie wollen für das Projekt arbeiten?
Registrieren Sie sich auf twago und geben Sie Ihr Angebot ab.
Sie möchten einen Experten finden?
Schreiben Sie Ihr Projekt aus und finden Sie die passenden Experten.
Version:5553

Über SSL Zertifikate
SagePAY
Diversity