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
artcher [175]
3 years ago
9

A car holds 16 gallons of gasoline and can travel 312 miles before refueling. Write aC++ program that calculates the number of m

iles per gallon the car gets. Display the result on the screen.
Computers and Technology
1 answer:
IgorC [24]3 years ago
6 0

Answer:

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

   // variables Declaration and initialization

   int no_gallon=16;

   int dis=312;

   // find the miles per gallon

   double mile_gallon=dis/double(no_gallon);

   // print the results

   cout<<"number of gallons: "<<no_gallon<<endl;

   cout<<"distance travel before refueling: "<<dis<<endl;

   cout<<"miles per gallon is: "<<mile_gallon<<endl;

return 0;

}

Explanation:

Declare and initialize the number of gallon and distance travel without refueling. Calculate the miles per gallon by dividing distance with number of gallons.Then print the results.

Output:

number of gallons: 16

distance travel before refueling: 312

miles per gallon is: 19.5

You might be interested in
WRITE A PROGRAM TO CALCULATE SIMPLE INTEREST
Alchen [17]

The simple interset program is a sequential program, and does not require loops and conditions

The simple interset program in Python, where comments are used to explain each line is as follows:

#This gets input for the principal amount

P = int(input("P = "))

#This gets input for the rate

R = int(input("R = "))

#This gets input for the number of years

N = int(input("N = "))

#This calculates the simple interest

I = P * R * T * 0.01

#This prints the simple interest

print("Simple Interest =",I)

Read more about simple interest at:

brainly.com/question/2294792

7 0
2 years ago
In basic network scanning, ICMP Echo Requests (type 8) are sent to host computers from the attacker, who waits for which type of
Hoochie [10]

Answer:

d. ICMP Echo Reply (type 0)

Explanation:

ICMP or internet control message protocol is an Internet layer protocol in the TCP/IP suite. It works together with routing devices like the router to send messages based on results sensed in the network.

The RFC 1122 has stated that the ICMP server and end user application be configured or installed in user devices, for receiving and sending ICMP echo request packets and reply. The process is called pinging.

For an attacker to implement ping of ping, he needs to confirm if the target user in live by sending an ICMP echo request packet type 8, to receive an ICMP echo reply type0.

4 0
2 years ago
The term drive app is used to describe applications stored on a computer true or false
Volgvan
Hello <span>Areyano7475
</span>

Question: T<span>he term drive app is used to describe applications stored on a computer true or false


Answer: False


Hope this helps
-Chris</span>
7 0
2 years ago
Read 2 more answers
Explain the principles of computer applications ​
9966 [12]

Answer:

The nature of computers and code, what they can and cannot do.

How computer hardware works: chips, cpu, memory, disk.

Necessary jargon: bits, bytes, megabytes, gigabytes.

How software works: what is a program, what is "running"

How digital images work.

Computer code: loops and logic.

Big ideas: abstraction, logic, bugs.

3 0
2 years ago
There are 12 inches in a foot and 3 feet in a yard. Create a class named InchConversion. Its main() method accepts a value in in
Dafna1 [17]

Answer:

import java.util.Scanner;

public class InchConversion

{

public static void main(String[] args) {

    Scanner input = new Scanner(System.in);

   

 System.out.print("Enter inches: ");

 double inches = input.nextDouble();

 

 inchesToFeet(inches);

 inchesToYards(inches);

}

public static void inchesToFeet(double inches){

    double feet = inches / 12;

    System.out.println(inches + " inches = " + feet + " feet");

}

public static void inchesToYards(double inches){

    double yards = inches / 36;

    System.out.println(inches + " inches = " + yards + " yards");

}

}

Explanation:

In the inchesToFeet() method that takes one parameter, inches:

Convert the inches to feet using the conversion rate, divide inches by 12

Print the feet

In the inchesToYards() method that takes one parameter, inches:

Convert the inches to yards using the conversion rate, divide inches by 36

Print the yards

In the main:

Ask the user to enter the inches

Call the inchesToFeet() and inchesToYards() methods passing the inches as parameter for each method

7 0
2 years ago
Other questions:
  • Is Apple a consumer or luxury brand? Give examples.
    10·1 answer
  • Unix has experimented with several security programs. a user can attach a watchdog program to a file that grants or denies acces
    13·1 answer
  • The Apple II is an IBM-compatible PC "clone".<br> True?<br> False?
    10·1 answer
  • Robin ensures that she is always available if anyone in the team needs her. Which quality is shown by robin?
    9·2 answers
  • Jack lost all the data he saved on his desktop because of a power outage while working on a presentation. On which of these comp
    15·2 answers
  • Write a structured algorithm that prompts the
    9·1 answer
  • What does the coding phase involve?
    11·2 answers
  • Complete the statement below with the correct term.
    12·1 answer
  • When designers follow accepted standards and protocols, which of the four basic characteristics of network architecture is achie
    6·1 answer
  • 1.Know the BMI of the user. First, the user will input the height in meters and weight in kilograms. After inputting, the inputt
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!