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
aliya0001 [1]
3 years ago
8

Write a program that reads a number in feet, converts it to meters, and displays the result. One foot is 0.305 meters. INPUT and

PROMPTS.The program prompts for the feet with the message "Enter a value for feet: ". OUTPUT. The output is of the form "x feet is y meters" where x is the number read in and y is the number of meters computed by the program.
Computers and Technology
1 answer:
sergij07 [2.7K]3 years ago
4 0

Answer:

using namespace std;

int main()

{

float x,y;

cout<<"Enter a value of feet: ";

cin>>x;

y=x*0.305;

cout<<x<<" feet is "<<y<<" meters";

return 0;

}

Explanation:

The program is written in C++ language but the problem can be carried out in any language using the premises given here.

You have to declare your variables for feet and meters (x and y in this case). The you prompt the user via the message on screen given by the cout word and the << sign, and the value read via the cin word and the >> sign and stored into x. Then you multiply x by 0.305 and store it in y, and show them on screen via cout. Note that literal words are written between " " and variables are written just like that.

You might be interested in
Output: Your goal
Sonja [21]

Answer:

1 n-var When you make a comparison, you consider two or more things and discover the differences between them. oft N of/between pl-n.

4 0
3 years ago
Jin needs to add a row into his spreadsheet, but he does not want to remove any existing data. Which combination of options shou
disa [49]

Answer:

b. insert > entire row

5 0
3 years ago
Read 2 more answers
Examples of hybrid computer​
Inga [223]

example, the Speedometer of a car measures the speed, changes in temperature in the body with a thermometer’s help, and weighs our body with a weighing machine.

6 0
3 years ago
Read 2 more answers
Computers are often referred to as _____.
GalinKa [24]
Smart machines I'm pretty sure
4 0
3 years ago
Write a program that contains three methods:
Reil [10]

Answer:

#include <stdio.h>//defining header file

int max (int x, int y, int z) //defining a method max that hold three parameters

{

   if(x>=y && x>=z)//defining if block that checks x is greater then y and x is greater then z

   {

       return x;//return the value x

   }

   else if(y>z)//defining else if block it check y is greater then z

   {

       return y;//return the value y

   }

   else//else block

   {

       return z;//return the value z

   }

}

int min (int x, int y, int z) //defining a method max that holds three parameters

{

if(x<=y && x<=z) //defining if block that check x value is less then equal to y and less then equal to z

{

return x;//return the value of x

}

if(y<=x && y<=z) //defining if block that check y value is less then equal to x and less then equal to z

{

return y;//return the value of y

}

if(z<=x && z<=x)//defining if block that check z value is less then equal to x  

{

return z;//return the value of z

}

return x;//return the value of z  

}

int average (int x, int y, int z) //defining average method that take three parameters

{

int avg= (x+y+z)/3;//defining integer variable avg that calculate the average

return avg;//return avg value

}

int main()//defining main method

{

   int x,y,z;//defining integer variable

   printf("Enter first value: ");//print message

   scanf("%d",&x);//input value from the user end

   printf("Enter Second value: ");//print message

   scanf("%d",&y);//input value from the user end

   printf("Enter third value: ");//print message

   scanf("%d",&z);//input value from the user end

   printf("The maximum value is: %d\n", max(x,y,z));//calling the method max

   printf("The minimum value is: %d\n", min(x,y,z));//calling the method min

   printf("The average value is: %d\n", average(x,y,z));//calling the method average

   return 0;

}

Output:

Enter first value: 45

Enter Second value: 35

Enter third value: 10

The maximum value is: 45

The minimum value is: 10

The average value is: 30

Explanation:

In the above-given code, three methods "max, min, and average" is declared that holds three integer variable "x,y, and z" as a parameter and all the method work as their respective name.

  • In the max method, it uses a conditional statement to find the highest number among them.
  • In the min method, it also uses the conditional statement to find the minimum value from them.
  • In the average method, it defined an integer variable "avg" that holds the average value of the given parameter variable.
  • In the main method, three variable is defined that inputs the value from the user end and passes to the method and print its value.      
7 0
3 years ago
Other questions:
  • Define reverse engineering in hacker context
    15·1 answer
  • Which is not a key factor a programmer uses in selecting the language for a project?
    9·1 answer
  • On an unweighted scale, a grade of A is worth _____ points
    7·1 answer
  • What is the definition of “potential energy”?
    6·1 answer
  • Write a C class, Flower, that has three member variables of type string, int, and float, which respectively represent the name o
    12·1 answer
  • What is the purpose of this parallelogram shape in a flowchart?
    15·1 answer
  • A gui allows you to interact with objects on the screen such as icons and buttons true or false
    7·1 answer
  • Why is translator required ​
    11·1 answer
  • The parental control service is experiencing technical difficulties.
    10·1 answer
  • Draw the following diagrams to represent the information system chosen in assignment 1 Context diagram The context diagram is ex
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!