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
anygoal [31]
4 years ago
6

Write a program that declares constants to represent the number of inches, feet, and yards in a mile. Name the constants INCHES_

IN_MILE, FEET_IN_MILE, and YARDS_IN_MILE respectively. Also declare a variable named miles to represent a number of miles. Compute and display, with explanatory text, the value in inches, feet, and yards—for example: 4.0 miles is 253440.0 inches, or 21120.0 feet, or 7040.0 yards
Computers and Technology
1 answer:
aliina [53]4 years ago
4 0

Answer:

The cpp program for conversion is given below.

#include <iostream>

using namespace std;

 

int main() {

 

// declaring and initializing constant variables with standard values

   const  double INCHES_IN_MILE=63360;

   const  double FEET_IN_MILE=5280;

   const  double YARDS_IN_MILE=1760;

   

   // declaring and initializing miles with a random value

   double miles=4.0;

   

// declaring and computing inches in miles

double inch = INCHES_IN_MILE*miles;

 

// declaring and computing feet in miles

double feet = FEET_IN_MILE*miles;

 

// declaring and computing yards in miles

double yard = YARDS_IN_MILE*miles;

 

// displaying all the calculated values

std::cout<<miles<<" miles is "<<inch<<" inches"<<std::endl;

std::cout<<miles<<" miles is "<<feet<<" feet"<<std::endl;

       std::cout<<miles<<" miles is "<<yard<<" yards"<<std::endl;

   

       return 0;      

}

OUTPUT

4 miles is 253440 inches

4 miles is 21120 feet

4 miles is 7040 yards

Explanation:

The steps in the program are as described.

1. All the three constant variables, mentioned in the question, are declared as double and initialized. These variables hold the fixed conversion values for inches, feet and yards in one mile.

2. The variables are declared constant using the keyword, const.

3. The variable to hold value for mile, miles, is declared as double and initialized with a random value.

4. Next, three more variables are declared as double. These variables will hold the calculated values for inches, feet and yards in the given value of mile.

5. The values are calculated for inches, feet and yards for the given value of variable, miles and stored in the variables mentioned in step 3.

6. These values are displayed to the console along with explanations.

7. The program ends with the return statement.

8. The value of variable, miles, is hard coded in the program and not taken from the user.

9. There is no interaction with the user in this program as this is not mentioned in the question.

10. The program works for all numeric value of the variable, miles, since double accepts integers also.

11. The program can be tested by changing the value of variable, miles.

You might be interested in
12. ______ is considered to be the first video game mascot.
Tatiana [17]
D pac man im hope im right
7 0
3 years ago
19. Which network topology is a combination of two or more types of physical or two or more types of logical topologies? A. Poin
marishachu [46]

Answer:b)-Hybrid topology

Explanation:

Hybrid is a type of topology which uses different types of topology. Hybrid topology uses the mix of ring, bus, mesh, star and tree topology. This topology is reliable as troubleshooting is easy without affecting other networks. Also, more network can be easily added to it without causing much interference.

The major disadvantage of hybrid topology is its complexity.

4 0
3 years ago
A restaurant recorded the ages of customers on two separate days. You are going to write a program to find the minimum age of a
Liono4ka [1.6K]

According to your code, you are setting the first element of the customerAges list as your baseline age. You then use a for loop to check each item in the list to see if it is less than your minimum variable. Then you assign the item to the minimum.

The missing line of code is b, if minimum > item:

I hope this helps!

7 0
3 years ago
Read 2 more answers
Data warehousing is a(n) __________, and data mining is a(n) ____________.
Maksim231197 [3]

Answer:

B. Process, group of techniques

Explanation:

Data warehousing simply means storing large amounts of data from multiple sources to a central "warehouse" to be analyzed or simply stored for later. Data mining on the other hand involves discovering patterns in sets of data to make better decisions. Analyzing data with a group of techniques like statistics and machine learning.

8 0
3 years ago
You need to apply security settings to the registry on a Windows server. Which command should you use
Mekhanik [1.2K]

There are different kinds of measures taken in security. The command should you use is   Certutil.

<h3>What is Certutil</h3>

Lawrence Abrams was known to be the man that mad Windows to have a built-in program called CertUtil.

This is often used to manage certificates in Windows where one can install, backup, delete, manage, and perform a lot of functions related to certificates and certificate that are saved in Windows.

See full question below

You need to apply security settings to the registry on a Windows server. Which command should you use?

certutil

regedit

regex

cipher

Learn more about Certutil from

brainly.com/question/24931496

7 0
2 years ago
Other questions:
  • Wendy is an attacker who recently gained access to a vulnerable web server running Microsoft Windows. What command can she use t
    9·1 answer
  • What can be used to describe and document the analysis and design of complex software systems?
    14·1 answer
  • How many different messages can be transmitted in n microseconds using three different signals if one signal requires 1 microsec
    12·1 answer
  • Use the drop-down menus to complete statements about managing meeting responses.
    13·1 answer
  • Edhesive 4.1 question 1
    9·1 answer
  • solve this simple question 1) Let S = {a, bb, bab, abaab} be a set of strings. Are abbabaabab and baabbbabbaabb in S*? Does any
    8·1 answer
  • Match each item with a statement below. - A popular port scanners that has the ability to use a GUI front end - Allows you to pi
    8·1 answer
  • What is Colby Knox known for?
    15·2 answers
  • What are the specifications of mine shaft head gear​
    11·2 answers
  • What makes a recipe for a meal an example of an algorithm?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!