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
Temka [501]
3 years ago
11

Driving is expensive. Write a program with two inputs, a car's miles/gallon and the cost of gas/gallon both represented as doubl

e variables, and output the total drive cost for 10 miles, 50 miles, and 400 miles, all on the same line, each separated by a single space.
Output each floating-point value with two digits after the decimal point, which can be achieved by executing the command
cout << fixed << setprecision(2); once before all other cout statements. That is done only once in the code before any cout stamtent.

Ps:(when i run the program it says this-
Enter miles per Gallon:
Gas cost for ten miles :-nan
Gas cost for fifty miles :-nan
Gas cost for four hundred miles:-nan
Computers and Technology
1 answer:
Nataly_w [17]3 years ago
6 0

Answer:33

Explanation:

You might be interested in
rocess inputs using the following 1) Write a function that inputs numerical digits in the range of an unsigned short. 2) Write a
yawa3891 [41]

Answer:

 /* sizeof.c—Program to tell the size of the C variable */

 /*      type in bytes */

 

 #include <stdio.h>

 

   int main(void)

  {

  printf( "\nA char   is %d bytes", sizeof( char ));

  printf( "\nAn int   is %d bytes", sizeof( int ));

  printf( "\nA short   is %d bytes", sizeof( short ));

  printf( "\nA long   is %d bytes", sizeof( long ));

  printf( "\nA long long is %d bytes\n", sizeof( long long));

  printf( "\nAn unsigned char is %d bytes", sizeof( unsigned char ));

  printf( "\nAn unsigned int  is %d bytes", sizeof( unsigned int ));

  printf( "\nAn unsigned short is %d bytes", sizeof( unsigned short ));

  printf( "\nAn unsigned long is %d bytes", sizeof( unsigned long ));

  printf( "\nAn unsigned long long is %d bytes\n",

   sizeof( unsigned long long));

 printf( "\nA float   is %d bytes", sizeof( float ));

 printf( "\nA double  is %d bytes\n", sizeof( double ));

 printf( "\nA long double is %d bytes\n", sizeof( long double ));

return 0;

 }

2. #include<stdio.h>

int main(){

  int num,reverse_number;

  //User would input the number

  printf("\nEnter any number:");

  scanf("%d",&num);

  //Calling user defined function to perform reverse

  reverse_number=reverse_function(num);

  printf("\nAfter reverse the no is :%d",reverse_number);

  return 0;

}

int sum=0,rem;

reverse_function(int num){

  if(num){

     rem=num%10;

     sum=sum*10+rem;

     reverse_function(num/10);

  }

  else

     return sum;

  return sum;

}

3.  

#include <bits/stdc++.h>  

 

using namespace std;  

/* Iterative function to reverse digits of num*/

int reversDigits(int num)  

{  

   int rev_num = 0;  

   while(num > 0)  

   {  

       rev_num = rev_num*10 + num%10;  

       num = num/10;  

   }  

   return rev_num;  

}  

 

/*Driver program to test reversDigits*/

int main()  

{  

   int num = 4562;  

   cout << "Reverse of no. is "

        << reversDigits(num);  

   getchar();  

   return 0;

4 0
3 years ago
Write a program that prompts the user to enter a positive integer and displays all its smallest factors in decreasing order.
user100 [1]

Answer:

<fact>[ZRjKt9sw6V(gh6E)ehNM3]<zip>

Explanation:

8 0
3 years ago
Which monitor will you prefer in your school ; CRT or FPD ?why ?
Serga [27]

Answer:

CRT

Explanation:

because this is very comfortable for me

7 0
3 years ago
Please help! I'll give you a medal!
SCORPION-xisa [38]
<span>A cyber community is a group of people that are visiting the same site and interacting with one another through it. If you are interacting with people on a website, you are part of a cyber community. If a friend wants you to watch a video at home, that is probably okay. If the content of that video bothers you though, you should say no or turn it off. If it's really bad, you may even need to tell someone. If your neighbor wants to be your friend online, that might be okay. I think you should probably let your parents know first and they can help you make a decision on that. If a stranger wants to be your friend, you need to say no and maybe even let an adult know.</span>
5 0
4 years ago
My mom and I are moving and we don’t have WiFi for the next week, I want to know if using a using a HOTSPOT WITH UNLIMITED DATA
Svetllana [295]

Answer:

Commercial HotSpots allows you mobility while regular wifi is a cheaper and reliable option while you are stale

Explanation:

8 0
3 years ago
Other questions:
  • Regarding an intrusion detection system (IDS), stateful matching looks for specific sequences appearing across several packets i
    9·1 answer
  • "If a VM is given exclusive access to hardware devices on the host computer, what new Windows Server 2016 feature is being utili
    14·1 answer
  • A raised dot (ú) shows where the ENTER key was pressed. <br> a. True<br> b. False
    15·1 answer
  • Which cloud computing service model will enable an application developer to develop, manage, and test their applications without
    15·1 answer
  • In order for two computers to communicate via the internet, they must first locate one another. How do computers locate one anot
    12·1 answer
  • vulnerability is a feebleness which allows an attacker to condense a system's information assurance to security,is it true or fa
    14·1 answer
  • Truck drivers probably cannot see your vehicle if you cannot
    6·2 answers
  • Write a program that reads in characters from standard input and outputs the number of times it sees an 'a' followed by the lett
    11·1 answer
  • If you would like to give another user permissions on your mailbox or to particular folders within your mailbox, which
    7·2 answers
  • What’s the highest stock today?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!