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
What is the output?
Scilla [17]

Answer:

The output of the code,

phrase = "hello mom"

phrase.upper()

Would be nothing since you didnt print out anything. How ever, the output of,

phrase = "hello mom"

print(phrase.upper())

Would be, "HELLO MOM". You can get the same output by writing this,

phrase = "hello mom"

phrase = phrase.upper()

print(phrase)

3 0
3 years ago
Read 2 more answers
Write a simple number guessing game Python program. In this code, generate a random integer between 1-10 (both included) and ask
seraphim [82]

Answer:

from random import randint

num = randint(1,10)

count =0

while count<3:

 userNum = int(input("Guess a Number "))

 if num ==userNum:

   print("You won")

   break

 else:

   print("Wrong try again")

 count = count+1

Explanation:

Import randint from random

generate a random number between (1,10) and assign to num

create a loop control variable count set to 0

In a While statement with the condition count<3 prompt user to make a guess

if guess is correct print you won and break

else print wrong try again and increase count by 1

6 0
3 years ago
have a folder on your Windows computer that you would like to share with members of your development team. Users should be able
sladkih [1.3K]

Answer:

Create a group and make all user accounts members of the group.

Explanation:

8 0
3 years ago
You just bought a new hard drive for your computer to replace your primary hard drive. After backing your data up and, then, ins
Fofino [41]


It manages the soft and hardware resources of the system. It also provides a stable, consistent way for applications to deal with the hardware without knowing all of the details of the hardware

8 0
3 years ago
Read 2 more answers
1. Which component is an input device?<br> CPU<br> b. hard drive<br> mouse<br> d. printer<br> e. RAM
Tanzania [10]
An input device would be anything you would use to change certain functionality, for instance a Mouse or Keyboard is an input device because it helps you input letters or clicks into the computer.
5 0
3 years ago
Other questions:
  • This is a device that enables computers to be connected to a network.
    14·1 answer
  • Which of the following is a malicious program that can replicate and spread from computer to computer?
    13·2 answers
  • A company has its branches spread over five places in a state. It has become difficult for employees to transfer information and
    7·1 answer
  • Create a stored procedure sp_Q1 that takes two country names like 'Japan' or 'USA'as two inputs and returns two independent sets
    10·1 answer
  • my airpods just do not seem to connect if i try to pair them, reset them, they have this continuous green light, please help me
    12·1 answer
  • Need help !!!!!!!!!!!!!!!
    7·1 answer
  • Use the Wrap Text icon to _____. modify which graphic appears in the front of layered images modify the picture effects change t
    5·2 answers
  • If you are going to refer to a few dozen classes in your application, how do<br> you do it?
    6·1 answer
  • Indicate whether the statement is true or false. ____ 1. Autoglobal array elements are referred to with an index number. ____ 2.
    9·1 answer
  • Write a program to check the password( qbasic)​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!