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
natita [175]
3 years ago
9

A variable like user_num can store a value like an integer. Extend the given program as indicated. Output the user's input. (2 p

ts) Output the input squared and cubed. Hint: Compute squared as user_num * user_num. (2 pts) Get a second user input into user_num2, and output the sum and product. (1 pt)
Computers and Technology
1 answer:
lapo4ka [179]3 years ago
7 0

Answer:

The answer to this question is given below in the explanation section. It is noted that this program is written in C++ using online C++ compiler.

Explanation:

#include <iostream>

using namespace std;

int squared(int num)// this is the function to compute square

   {

       return num*num;

   }

int cube(int num)// this is the function to compute cube

   {

       return num*num*num;

   }

int main()

{

   int user_num, user_num2; // variable declaration

   

       cout<<"Enter the first number: ";//prompt user to enter the number

       cin>>user_num;//store the user entered number into variable

       cout<<"\nEnter the second number: ";//prompt the user to enter the second number

       cin>>user_num2;//store the user entered number into variable

   

   

   cout<<"\nSquared of first number is: "<<squared(user_num);//compute square of user_num and display

   cout<<"\nCube of first number is: "<<cube(user_num);//compute the cube of the user_num and display

   cout<<"\nSquare of second number is: "<<squared(user_num2);//compute the square of user_num2 and display

   cout<<"\nCube of second number is: "<<cube(user_num2);//compute the cube of user_num2 and display

   

   cout<<"\nSum of number 1 and number 2 is: "<<user_num2 + user_num2;//display the sum of user_num2 and user_num

   cout<<"\nProduct of number 1 and number 2 is: "<<user_num2 * user_num;//display the product of user_num and user_num2

   

   

   return 0;//terminate the program

}

                               

You might be interested in
Name and describe the various features of the PC support pages of About.com.
erma4kov [3.2K]

Answer: Awnser below.

Explanation:

Basically, what you're going to need for a computer from my basic knowledge is a motherboard, of course, this is so you can actually use your computer. You'll need a PSU, or so called, a power supply. This will give power to your motherboard and the other components with it. You will need a CPU, this is basically the brains of the computer. This will run your operating system, and main componets. A GPU, this will give you a display for your monitor. And of course, ram. Ram will be giving you display for your monitor, and for running tasks.

For more components, you would need a hard drive, or an SSD, which will store your files and operating system. And of course, a keyboard, mouse, and monitor.

7 0
3 years ago
Read 2 more answers
All of the following are considered active job search methods EXCEPT _____. a. sending out resumes b. attending job training pro
LuckyWell [14K]
A sending out resumes
5 0
3 years ago
Read 2 more answers
3 component of a computer
madam [21]

Answer:

Hardware

software

Humanware

6 0
3 years ago
What I'd the keyboard shortcut for applying bold font to a text selection ​
garik1379 [7]

It is the second option

3 0
3 years ago
How do you optimize a website using JavaScript?
GenaCL600 [577]
You can edit the website (using Wordpress) -if it is your website of course-, and code JavaScript commands into the page that’s going to be uploaded.

Check out my website: www.birdbloggersblog.com

I coded that with HTML.
4 0
3 years ago
Other questions:
  • Consider the classes below, declared in the same file: class A { int a; public A() { ​ a = 7; } } class B extends A { int b; pub
    6·1 answer
  • The command to delete all the files that have filenames that starts with letter c or c and ends with a letter z or z is
    15·1 answer
  • When you respond to an email from your bank that asks you to verify your account information, you may become a victim of a _____
    14·1 answer
  • write a function that takes a string as parameter, return true if it’s a valid variable name, false otherwise. You can use keywo
    6·1 answer
  • It is safe to interchange oxygen and fuel gas hoses. A. False B. True
    13·2 answers
  • You need to update both the DEPARTMENT_ID and LOCATION_ID columns in the EMPLOYEES table using one UPDATE statement. Which claus
    5·1 answer
  • Jessie will make and sell the trending Baked California Maki. Her Peso mark up is 5.00. Selling price PHP 15.000. How much will
    7·1 answer
  • Write a program using for loop to find the cube of numbers from 50-100 <br> FASTT
    11·1 answer
  • I know that this will be taken down for not being a real question but is anyone else not able to search for anything? I can type
    13·1 answer
  • which endpoint application runs on an endpoint device that only detects an attack in an endpoint device? chqgg
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!