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
List five applications field of a computer?​
True [87]

list five applications field of a computer?

answer= <em> </em><em>home</em><em> </em><em>,</em><em> </em><em>school</em><em>,</em><em> </em><em>h</em><em>o</em><em>spital</em><em>,</em><em> </em><em>bank</em><em>,</em><em> </em><em>super</em><em> </em><em>markets</em><em>,</em><em> </em><em>etc</em><em>.</em><em>.</em><em>.</em><em>.</em>

5 0
3 years ago
When working in Photoshop with the move tool, you can select multiple layers and use this option to arrange them into a straight
wel

Answer:

Distribute -  will put all of the layers in a straight line across the image

6 0
3 years ago
Read 2 more answers
The Go To feature can be accessed from which of the following dialog boxes?
Aliun [14]

Answer:

hoose the answer.

•Font

•Open

•Insert Hyperlink

Explanation:

4 0
3 years ago
A network is a group of two or more computers or devices connected together. To be able to connect, they each need a
Kay [80]
D. Internet service protocol (isp)
6 0
3 years ago
Read 2 more answers
Please code in python and add comments to code
Gnoma [55]

#accepting input from user

n=int(input("Enter a number: "))

#entered number is stored in a temporary variable

temp=n

#initializng required variables

rev=0

dgt=0

#digits are reversed inside while loop

while(n>0):

dgt=n%10

rev=rev*10+dgt

n=n//10

#original number and its reverse are compared

if(temp==rev):

#if equal, it's a palindrome

print("It is a Palindrome")

else:

#if not equal, it's not a palindrome

print("It is not a Palindrome")

#◌⑅⃝●♡⋆♡Nåmřāthā♡⋆♡●⑅◌

4 0
2 years ago
Other questions:
  • ___________ is an unsecured client server application / protocol that transfers files between two computers.
    11·1 answer
  • Apart from confidential information, what other information does NDA help to outline?
    15·1 answer
  • E-fit and similar software compares what?
    7·1 answer
  • Create a structure named planet This structure will contain distance from Earth as an integer Atmosphere, language, people and p
    8·1 answer
  • Indenting the start and finish of segments
    8·2 answers
  • Different video files and ______ can cause compatibility issues to arise between computer systems.
    8·1 answer
  • Which of the following are documents that can help you to review and assess your organization’s status and state of security? Fi
    6·1 answer
  • I need urgent help. which of these network has minimum data loss. a. LAN b. MAN c. WAN ​
    11·1 answer
  • Small data files that are deposited on a user's hard disk when they visit a website are called _______.
    6·2 answers
  • Which programming paradigm does the programming language JavaScript follow?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!