Question

In: Computer Science

Write the program that prints the product of 79 and 3.684. The output statement should be...

Write the program that prints the product of 79 and 3.684. The output statement should be descriptive, and should include the printing of all three variables (the two operands as well as the product). Write In C++

Solutions

Expert Solution

Write the program that prints the product of 79 and 3.684 he output statement should be descriptive, and should include the printing of all three variables (the two operands as well as the product). Write In C++..

#include<iostream>//libraries
using namespace std;//
int main() //main fuction
{
int n = 79,m = 3.684,q; //assigning values to variables or operands
cout <<"the product of 79 and 3.684 is "; //just string what is going on
q = (n*m); // logic for product of two variables assigned to another variable or product
cout << n<< "*"<<m<<"="<< q<< endl; // printing the all three variables.
  
return 0;
}

output:

the product of 79 and 3.684 is 79*3.684 = 237

Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. von * * *** **** ************************************************************* 8 #include <iostream>//header 9 using namespace std; 10 int main() 7/main fuction 11 int n = 79,- = 3.684,9://assigning values to variables cout <<"the product of 79 and 3.684 is "://just string 14 q = (nºm);// Logic for product of two variables assigned to another variable cout <<n<<"*" << < " = " << << endl; // printing the all three variables. 12 return 0; the product of 79 and 3.684 1879 3 = 237


Related Solutions

Write a program that uses a while statement to read integers from the user and prints...
Write a program that uses a while statement to read integers from the user and prints the sum, average, and largest of these numbers. The input should terminate if the user enters 999. The average should be output with 4 digits of precision. c++ please ASAP
Write an assembly language program that prints your first name in the output. Use immediate addressing...
Write an assembly language program that prints your first name in the output. Use immediate addressing with a hexadecimal constant to designate the operand of CHARO for each letter of your name. Comment each line except STOP and END. Cut and paste the Assembler Listing into your document and paste a screen shot of the Output area of the Pep8. Use the name "Kevin" as example Assembler Listing Screen Shot of Output area of the Pep8 program
With C code Write a switch statement (not a complete program) which prints an appropriate message...
With C code Write a switch statement (not a complete program) which prints an appropriate message for a letter code entered. Use the following messages: If L is entered, output the message "Lakers" If C is entered, output the message "Clippers" If W is entered, output the message "Warriors" If any other character is entered, output the message "invalid code" Make sure to handle the case where the user enters in a small letter. That is, a capital or small...
Write a program that asks the user for an integer. The program checks and prints to...
Write a program that asks the user for an integer. The program checks and prints to the screen whether the number is prime or not. For example, if user enters 17, the program should print “17 is prime”; if the user enters 20, the program should print “20 is not prime”. please do it with a “ while Loop”, Thanks..
Write a program that reads students’ names followed by their test scores. The program should output...
Write a program that reads students’ names followed by their test scores. The program should output each student’s name followed by the test scores and the relevant grade. It should also find and print the highest test score and the name of the students having the highest test score. Student data should be stored in a struct variable of type studentType, which has four components: studentFName and studentLName of type string, testScore of type int (testScore is between 0 and...
Write a program that prints the insurance fee to pay for a pet according to the...
Write a program that prints the insurance fee to pay for a pet according to the following rules:(NOTE:You must use a switch statement to determine pet fee.)A dog that has been neutered costs $50.A dog that has not been neutered costs $80.A cat that has been spayedcosts $40.A cat that has not been spayedcosts $60.A bird or reptile costs nothing.Any other animal generates an error message.The program should prompt the user for the appropriate information: a character code for the...
Programming in C++ Write a program that prints the values in an array and the addresses...
Programming in C++ Write a program that prints the values in an array and the addresses of the array’s elements using four different techniques, as follows: Array index notation using array name Pointer/offset notation using array name Array index notation using a pointer Pointer/offset notation using a pointer Learning Objectives In this assignment, you will: Use functions with array and pointer arguments Use indexing and offset notations to access arrays Requirements Your code must use these eight functions, using these...
Write a Java program that takes in a string and a number and prints back the...
Write a Java program that takes in a string and a number and prints back the string from the number repeatedly until the first character... for example Pasadena and 4 will print PasaPasPaP. Ask the user for the string and a number Print back the string from the number repeatedly until the first character For both programs please utilize: methods arrays loops Turn in screenshots
Write a short program that asks the user for a sentence and prints the result of...
Write a short program that asks the user for a sentence and prints the result of removing all of the spaces. Do NOT use a built-in method to remove the spaces. You should programmatically loop through the sentence (one letter at a time) to remove the spaces.
Create a program that parses a CSV file of product data and prints the items with...
Create a program that parses a CSV file of product data and prints the items with a price that is less than or equal to that input by the user. • Your program should take two arguments: an input file to process and a price limit. • Print only the names of each item to stdout that have a price less than or equal to the given limit. • If the given file does not exist or cannot be opened,...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT