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]
4 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]4 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
Sum of 18/7 and 13/7 is *​
NARA [144]
The sum would be 31/7, or 4.428571428571429 in decimal form.
7 0
3 years ago
Read 2 more answers
Microsoft excel is a __________ application.
Nastasia [14]
B. spreadsheet is the answer
3 0
4 years ago
There is an interface I that has abstract class AC as its subclass. Class C inherits AC. We know that C delegates to an object o
Aloiza [94]

Answer:

are u in HS or college work

I am trying to understand

6 0
3 years ago
Clicking on this will minimize all open windows.
vfiekz [6]
I believe it is the the Show Desktop Icon.
Hope this helps! <3
4 0
3 years ago
Read 2 more answers
Technology trends in education play a key role in a student’s: social life. motivation. career readiness. job search.
skelet666 [1.2K]

Answer:

job search

Explanation:

job search bc you can look for jobs that are avalible online.

4 0
3 years ago
Read 2 more answers
Other questions:
  • What are the main types of computer software?
    5·2 answers
  • Do AirPods Pro have a green flashing light when charging?
    11·2 answers
  • Virtual private network requires a secure remote connections<br><br> true or false?
    11·1 answer
  • How are a cell's content and format related?
    12·2 answers
  • Ile 1 cm<br> ?<br> 50 m<br> The an
    5·2 answers
  • Given two variables , first_place_winner and second_place_winner, write some code that swaps their associated values. use any ad
    12·1 answer
  • What is the computer that is similar to a destop but smaller in size
    8·1 answer
  • Which of the following guidelines about the subject line of e-mail messages is most appropriate?
    15·2 answers
  • Phoebe is a Counselor who is trying to schedule a meeting with one of her patients. Which best describes an inappropriate locati
    10·2 answers
  • In a selection, the else clause executes ______________. a. always b. when the tested condition is false c. when the tested cond
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!