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
Choose the two main capabilities involved in visual literacy
andreyandreev [35.5K]

The two main capabilities involved in visual literacy are:

<span>1)   </span>Communication through use of visual elements.

<span>2)   </span>Interpret meaning from visual elements.

<span>Visual literacy is the capacity to decipher, arrange, and make significance from data displayed as a picture, broadening the importance of proficiency, which means understanding of a composed or printed content.</span>

7 0
3 years ago
I plugged my headphones into my computer, but the sound still came out of the speakers. help!
VARVARA [1.3K]

If you mean speakers. You should remove them or if you mean the speakers in the PC. Perhaps you put the headphones in the wrong one. Theres usually too one in the front and the other one in the back of the desktop.





Hope this helps.


Regards. Shaggy


Enjoy your music!

3 0
3 years ago
Read 2 more answers
What type of space is often the main focal point of the composition in graphic design
iogann1982 [59]

Answer: what are the choices?

Explanation:

3 0
3 years ago
You can use ____ arguments to initialize field values, but you can also use arguments for any other purpose.
Fofino [41]
B.constructor I think that’s the answer
7 0
3 years ago
Run-time parameters passed to a function allow you to use different values each time the function is called.
stich3 [128]

Answer:

True

Explanation:

Run-time parameters passed to a function allow you to use different values each time the function is called. Let us consider an example:

int add(int a,int b){

   return a+b;

}

Now we can execute the same function with different parameters at runtime:

add(3,4) returns 7.

add(1,2) return 3.

add (10,1) return 11.

During each invocation , the formal function parameters are substituted by actual runtime values and the function code is executed.

8 0
3 years ago
Other questions:
  • What dose it need For a device to be considered a kind of computer
    14·2 answers
  • Expressing your needs to others is aggressive behavior.<br> True or False?
    5·2 answers
  • Could this be restored? And is it worth the money it’d take?
    9·2 answers
  • Stealing passwords by using software code to run through various password schemes with numbers, symbols, capital letters, and ch
    6·1 answer
  • A sequence of one or more characters is called
    14·1 answer
  • To switch from one open document to another, press _____.
    6·1 answer
  • How can you tell the value of a purchase?
    7·1 answer
  • You have two microservices that need to communicate with each other without holding up a thread on either end. One service will
    6·1 answer
  • Computer simulations were first developed during __________<br> as a part of the _____________
    5·1 answer
  • Question 1 (1 point)
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!