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
Sliva [168]
3 years ago
6

Write a program that requires the user to enter two floating-point numbers (num1 and num2) from the keyboard. Multiply them and

display the original two numbers and the calculated floating-point product. When displaying the floating-point numbers, limit your output display to 3 digits after the decimal point (for example, display 23.567810 as 23.568).
Computers and Technology
1 answer:
kogti [31]3 years ago
5 0

Answer:

#include <iostream>

#include <iomanip>

using namespace std;

int main()

{

   float num1,num2,product;

   cout<<"Input first number: ";

   cin>>num1;

   cout<<"Input second number: ";

   cin>>num2;

   product = num1*num2;

   int digits = 3;

  cout << " (rounded to " << digits << " digits after the decimal point )"<< fixed << setprecision(digits) << num1 << "*" << num2 <<  " = " << product << "\n";

   

   return 0;

}

Explanation:

iostream is a standard library file that contains code that allows a C++ program to display output on the screen and read input from the keyboard.

iomanip is a standard library used for formatting your output.

using namespace std means that you are going to use classes or functions  from "std" namespace,

int main() is used as the entry point of the program, it contains your code and the  main() is the function from where the program will start to execute.

float num1,num2,product;

you have to first declare the variables and assign them to a data type float.

   cout<<"Input first number: ";

   cin>>num1;

   cout<<"Input second number: ";

   cin>>num2;

prompt and collect inputs for num1 and num2

product = num1*num2;

calculate the product of num1 and num2

int digits = 3;

the number of digits you want after the decimal point

cout << " (rounded to " << digits << " digits after the decimal point )"<< fixed << setprecision(digits) << num1 << "*" << num2 <<  " = " << product << "\n";

fixed ensures that the precision that you have set will remain constant through out the code.

setprecision(digits)  this allows you to set the precision

You might be interested in
What are some catchy names for computer basics that you would put on a childrens poster?
Triss [41]

Answer:

not sure

Explanation:

6 0
3 years ago
How to do this PLEASE HELP 80 points!
sp2606 [1]

When reading the story, you know that the code has been created by humans, so it might actually be english and use concepts like our number system, our computer code system (I'm thinking ASCII), things that you should not assume when decoding a real alien message.

Looking at the numbers I notice that digits 6 to 9 do not occur in the message, which is statistically unexpected. This leads me to believe the number base might be 6 rather than our common base 10. In the story there are insects mentioned. Insects have 6 legs, so this makes sense (after all, our base 10 was based on the number of fingers).

Next, I notice the code 052 appearing regularly, so that could be a space. Let's check a hypothesis. 052 in base 6 is 5*6+2 = 32. 32 is the ASCII code for a space!!

Now, a decoding algorithm is ready to be devised:

"for each number in the sequence, parse it as a base-6 number and then print out its corresponding ASCII value".

The following node.js snippet does this:

var code = ['220','241','255','245','052','313',

           '311','052','312','303','052','312',

           '252','245','052','205','241','251',

           '253','243','052','203','253','302',

           '251','244','303','301','053'];

           

var msg = "";

for (let n of code) {

   msg += String.fromCharCode(parseInt(n,6));

}

console.log(msg);


And the message is.........:

<em>Take us to the Magic Kingdom!</em>

So, do these aliens want to visit Disneyland????

5 0
2 years ago
Which tab is used to insert a hyperlink onto a slide?
babunello [35]

the answer is C. Insert

3 0
3 years ago
What is the difference between auto fill and fill handle ?​
lidiya [134]

Answer:

  • Auto fill a software function that automatically completes data (like the data that has been entered previously) without the user needing to type it in full.

  • The Fill Handle is a feature in Excel that fills the data automatically with a specific pattern in your spreadsheet cell.

hope u liked the answer :)

7 0
2 years ago
Omega Software Inc. is currently running a training program for employees to upgrade their software skills so that they are able
MArishka [77]

Answer:

Omega Software is attempting to make a change in the area of people.

Explanation:

Types of Organizational Change:

Most organizations have to go through a change to keep up with the changing market dynamics, trends and technologies. There are four major types of organizational change:

  1. Structural
  2. Strategic
  3. People
  4. Process

People change:

One of the organizational change is people change where organizations strive towards the improvement of their employee's skills set and productivity. This is usually achieved by launching various specialized and general training programs for employees to enhance their knowledge and widen their skills set so that they can work more efficiently for the organization.

Therefore, it can be concluded that Omega Software is attempting to make a change in the area of People.

3 0
2 years ago
Other questions:
  • Which of the following jobs is considered part of the information technology industry?
    15·2 answers
  • Develop a list of privacy protection features that should be present if a website is serious about protecting privacy. Then, vis
    8·1 answer
  • Chen needs to configure a filter on the current folder and would like to filter by the sender of a message. Which tab in the Fil
    7·2 answers
  • (Convert milliseconds to hours, minutes, and seconds) Write a function that converts milliseconds to hours, minutes, and seconds
    12·1 answer
  • Match each role to the corresponding web development task.
    14·1 answer
  • A style sheet consists of CSS ______________________ that specify the layout and format properties to apply to an element. *
    13·1 answer
  • ______________ are used to store information that will be referenced and manipulated in a computer program. They label data with
    6·1 answer
  • 3. It is important to make certain that your employees are aware of the work ethic
    13·1 answer
  • A __________ attack is a bot attack on a computer system or network that causes a loss of service to users.
    15·1 answer
  • you want to run your campaign for your dry-cleaning service across three different publishers, each with different video creativ
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!