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
Which one of the following types of statements is an instruction to replace the existing value of a variable with another value?
Greeley [361]

Answer:

The answer is "Option c"

Explanation:

The assignment is the statement used to determine the value of the programming variable. It is also regarded as the same sign indicating the function (=) in the operator. This operand works by allocating the operand's value to the right-hand side, and other choices are not correct that can be described as follows:

  • In option a, It is a keyword that is used to update table details.
  • In option b, It is part of programming, which is used to the declared variable.
  • In option d, It is used to assign value in variable.  
8 0
3 years ago
Who like anime becus i dooooo ( wrote this becuse i forgot what i was writing abot)
mars1129 [50]

Answer:

My bestie loves Animes...... I don't watch anime But good at drawing anime(◠‿◕)

4 0
3 years ago
unscramble the letters to identify which step of the scientific method each statement repesents why is the sliced cheese in the
Rudiy27
Sorry the only word I could get from that is problem, is that possibly the answer?
5 0
3 years ago
. ____________is/are the JSP ImplicitObject(s).sessionapplicationconfigAll of GivenNone of Given
Lynna [10]

Answer:

All of Given

Explanation:

JSP provides a number of implicit objects which are made available by the container and can be used directly in scriptlets. These objects include:

  • session
  • application
  • config
  • out
  • request
  • response
  • pageContext
  • page
  • exception

Example usage:

<% session.setAttribute("userid","demoid"); %>

<% application.getContextPath(); %>

<% out.println(config.getServletName()); %>

5 0
3 years ago
Please Help! I will give a Brainliest to anyone who answers with the right answer! Please and Thank You! What view is most often
Nata [24]

Answer:

form is used ethier to display or enter data in access 2016

8 0
3 years ago
Other questions:
  • Alpha Technologies, a newly established company, wants to share information about its work with people all over the world. Which
    9·1 answer
  • In this lab you used the sharing and storage management console to create a simple volume. what must you do to create a differen
    13·1 answer
  • What protocol communicates data between routers representing the edges of autonomous systems?Distance-vectorLink stateInterior g
    11·1 answer
  • Create detailed pseudocode for a program that calculates how many days are left until Christmas, when given as an input how many
    15·1 answer
  • Random integer between 3 and 13 (inclusive)
    8·2 answers
  • How to shutdow computer
    7·1 answer
  • If Jake wants to find out if the size of a fruit has any effect on the total sales for the week of that particular fruit, what c
    15·1 answer
  • Identify the technique to free up the CPU by allowing device controllers to independently transfer data between the device and m
    7·1 answer
  • What dod instruction implements the dod cui program
    14·1 answer
  • Operational level management can be supported by the systems except Select one: 01. Transaction Processing System 2. Manufacturi
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!