1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
RoseWind [281]
3 years ago
5

Hello everyone. I need help. C programming. Create at least two more functions except the main () function to collect them.

Computers and Technology
1 answer:
Andrew [12]3 years ago
3 0

Answer:

Explanation:

#include <iostream>

using namespace std;

int costdays(int);

int costhrs(int,int);

int main()

{

   int dd,hh,mm,tmph,tmpd,tmpm=0;

   int pcost,mcost=0;

   cout<<"Enter Parking time" << endl;

   cout<<"Hours: ";

   cin>>hh;

   cout<<"Minutes: ";

   cin>>mm;

   

   if (mm>60)

   {

       tmph=mm/60;

       hh+=tmph;

       mm-=(tmph*60);

   }

   if (hh>24)

   {

       tmpd=hh/24;

       dd+=tmpd;

       hh-=(tmpd*24);

   }

   if ((hh>4)&&(mm>0))

   {

       pcost+=costdays(1);

   }

   else

   {

       mcost=costhrs(hh,mm);

   }

   cout<<"Total time: ";

   if (dd>0)

   {

       cout<<dd<<"days ";

       pcost+=costdays(dd);

   }

   pcost+=mcost;

   cout<<hh<<"h "<<mm<<"mins"<<endl;

   cout<<"Total Cost :"<<pcost<<"Won";

   return 0;

}

int costdays(int dd)

{

   return(dd*25000);

}

int costhrs(int hh,int mm)

{

   int tmpm, tmp=0;

   tmp=(hh*6)*1000;

   tmp+=(mm/10)*1000;

   tmpm=mm-((mm/10)*10);

   if (tmpm>0)

   {

       tmp+=1000;

   }

   return(tmp);

}

You might be interested in
Sarah is a detail-oriented programmer. While testing her program, what other skill would she have to apply in order to detect al
Talja [164]

Answer:

A. troubleshooting

Explanation:

Troubleshooting is the process of trying to detect problems with a software or hardware component so as to apply solutions to it.

Therefore, Sarah would need troubleshooting skills to help her test her program to detect all bugs and fix it.

3 0
2 years ago
___________ key encryption in wep uses the rc4 encryption algorithm.
lora16 [44]

Shared key encryption in wep uses the rc4 encryption algorithm.

7 0
2 years ago
You just read a restaurant review on the internet of the newest restaurant in town. The writer of the article said the food was
Marizza181 [45]
A. The restaurant review contains data but is not data itself. 
I'm sorry if that's wrong, but that seems right to me. 

6 0
3 years ago
How does the computer help me with school work
Alex73 [517]
You are able to mark your answers on tests and save your work, while on paper, you get it taken away from you.
7 0
1 year ago
Read 2 more answers
When pasting an existing chart into a Word document, you can choose to _______ using the Paste Options button.
SCORPION-xisa [38]
When pasting an existing chart into a Word document, you can choose to control how text appears when you paste it using the Paste Options button.  <span>The </span>Paste Options<span> button enables you to decide whether you want to paste the data as you originally copied it, or to change the style so that it fits the style of the document into which you are pasting the data, or to apply specific characteristics to the data, based on the content.</span>
8 0
3 years ago
Read 2 more answers
Other questions:
  • In what decade did the Internet begin to be used widely by the public and not just government entities?
    5·2 answers
  • A ____ client locates all or most of the processing logic on the server.
    11·1 answer
  • Brainly won't let me create an account even though i tried multiple emails and ages! It keeps saying "We're sorry, but we are no
    8·2 answers
  • The function below takes a string argument sentence. Complete the function to return the second word of the sentence. You can as
    5·1 answer
  • A company wants a recruiting app that models candidates and interviews; displays the total number of interviews each candidate r
    6·1 answer
  • What kind of game was pole position?
    6·2 answers
  • As the network engineer, you are asked to design an IP subnet plan that calls for three subnets. The largest subnet needs a mini
    14·1 answer
  • Does anyone have the GCSE 2018 Design Technology J310/01 practice paper?
    15·1 answer
  • Which of the following is not true about VOIP?
    9·1 answer
  • Describe the main roles of the communication layer, the network-wide state-management layer, and the network-control application
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!