Question

In: Computer Science

C ++ code that accepts any measurement in meters entered by the user through the keyboard...

C ++ code that accepts any measurement in meters entered by the user through the keyboard and displays the equivalent measurement in feet on the console (1 Meters = 3.2808 Feet). Use proper variable names.

Solutions

Expert Solution

C++ code:

#include <iostream>
using namespace std;
int main(){
//initializing meter and feet
float meter,feet;
//asking for measurement in meters
cout<<"Enter measurement in meters:";
//accepting measurement in meters
cin>>meter;
//finding measurement in feet
feet=meter*3.2808;
//printing measurement in feet
cout<<"Measurement in feet: "<<feet<<endl;
return 0;
}

Screenshot:


Input and Output:


Related Solutions

Write a C++ program that accepts a single integer value entered by user. If the value...
Write a C++ program that accepts a single integer value entered by user. If the value entered is less than one the program prints nothing. If the user enters a positive integer n. The program prints n x n box drawn with * characters. If the user enters 1 , for example the program prints *. If the user enter a 2, it prints ** ** that is , a 2x2 box of * symbols.
*Please write code in C++* Write a program to verify the validity of the user entered...
*Please write code in C++* Write a program to verify the validity of the user entered email address.   if email is valid : output the stating that given email is valid. ex: "The email [email protected] is valid" else : output the statement that the email is invalid and list all the violations ex:  "The email sarahwinchester.com is invalid" * @ symbol * Missing Domain name The program should keep validating emails until user enter 'q' Upload your source code. ex: main.cpp
Write Java code that accepts the integer input (from keyboard) in an arraylist named num1 and...
Write Java code that accepts the integer input (from keyboard) in an arraylist named num1 and stores the even integers of num1 in another arraylist named evennum.
Write a C++ program that accepts a positive integer number from the keyboard . The purpose...
Write a C++ program that accepts a positive integer number from the keyboard . The purpose of the program is to find and the display all the square pair numbers between 1 and that number. The user should be able to repeat the process until he/she enters n or N in order to terminate the process and the program. Square numbers are certain pairs of numbers when added together gives a square number and when subtracted also gives a square...
Write a C++ program that finds the minimum number entered by the user .The user is...
Write a C++ program that finds the minimum number entered by the user .The user is allowed to enter negative numbers 0, or positive numbers. The program should be controlled with a loop statement. Break statements is not allowed to break from loop. After each number inputted by the user, The program will prompt user if they need to enter another number. User should enter either Y for yes or N for no. Make Sure the user enters either Y...
modify the code below to create a GUI program that accepts a String from the user...
modify the code below to create a GUI program that accepts a String from the user in a TextField and reports whether or not there are repeated characters in it. Thus your program is a client of the class which you created in question 1 above. N.B. most of the modification needs to occur in the constructor and the actionPerformed() methods. So you should spend time working out exactly what these two methods are doing, so that you can make...
Design, code, and test a program that accepts positive integers until the value 204 is entered....
Design, code, and test a program that accepts positive integers until the value 204 is entered. After input terminates, the program should report the total number of even integers (excluding the special number 204) , the average value of the even integers, the total number of odd integers, and the average value of the odd integers. The program should also report "Evens won!", "Odds won!", or "Evens and odds tied!" based on which total was greater. Test your program thoroughly...
Write an interactive C program that asks a user to enter a sentence from the keyboard,...
Write an interactive C program that asks a user to enter a sentence from the keyboard, and prints the sentence with all the words spelled backwards. Note: you may assume that each sentence will have at most 50 characters and each word is separated by a space. Sample code execution: bold information entered by user enter a sentence: hello ece 175 class olleh ece 571 ssalc continue (q to quit)? y enter a sentence: May the force be with you...
2) Write a C++ program that accepts a sentence as an input from the user. Do...
2) Write a C++ program that accepts a sentence as an input from the user. Do the following with the sentence. Please use C++ style string for this question. 1) Count the number of letters in the input 2) Change all lower case letters of the sentence to the corresponding upper case
C code only, not C++ or anything else // This program accepts the chest size from...
C code only, not C++ or anything else // This program accepts the chest size from the customer // and returns the proper shirt size as well as the price. // function prototype void check_size_price(int size_val, char *size_char, int *price); #include <stdio.h> int main() { int chest_size; //input - entered chest size char size_str; //output - size (S/M/L) int p; //output - price // validation loop for the input – the chest size must be a positive integer // Call...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT