Write a program that prompts the user to enter the area of the carpet in square meters and the unit price per square meter. The values are to be read into an integer area and a float unitCost respectively. Define the variables and use only one statement to read them. Afterwards, print each value with the name of the variable on a separate line
int main()
{
// Declare the variables you need here. Hint: A float and integer.
// Ask for user input here. Hint: std::cin
// Put your output statement here
// Hint: Remember to output to the console you use std::cout
}
Like Zereo said, in your main function you will need to declare the variables you are going to use first. You will need a float and an integer (int).
Next, you will need to get the user's input and assign it to the variables. You can do that using std::cin .
Then you need to output the statement. To output to the console, you can use std::cout .