answer.
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]
2 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]2 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
Peter took a selfie in his room. He was a wearing a light blue shirt. But he failed to realize that that shirt would clash in co
Leto [7]

Answer:

A wand tool is to do that in an editing software.

7 0
2 years ago
Read 2 more answers
Two devices are connected to the Internet and communicating with one another. A squirrel chews through one of the wires in the n
bearhunter [10]

Answer:

Fault-Tolerance

Explanation:

Fault tolerance refers to the ability of a system (computer, network, cloud cluster, etc.) to continue operating without interruption when one or more of its components fail.

5 0
2 years ago
The Tell Me feature also includes access to the _____ feature.
Ierofanga [76]

Answer:

the quick access toolbar can be customized to include additional commands such as. -"tell me what you want to do" box ... custom programs or additional commands that extend the functionality of a Microsoft office program ... in the open window. it also includes ribbon display options and control buttons that enable you to ...

Explanation:

7 0
2 years ago
Type the correct answer in the box. Spell all words correctly.
wlad13 [49]

Ryan should apply a filter/criteria on the Courses column and view all the courses that show Sociology

3 0
1 year ago
Using information from the lesson, explain how new technologies change your experience as a consumer.
densk [106]

Technological improvements allow me to have greater access to goods around the world. I can buy instantly and communicate instantly with producers. Technology can also help me to monitor economic trends, both in my country and in my own life. In summary, technology helps to give me more freedom to make economic choices.

On e2020

6 0
2 years ago
Read 2 more answers
Other questions:
  • The final step of the DHCP Discovery process is known as...
    8·1 answer
  • A class car and its subclass bmw each have a method run(), which was written by the developer as part of the class definition. i
    10·1 answer
  • Lin is booting up his computer, and during the boot process, the computer powers down. After several unsuccessful attempts to bo
    12·1 answer
  • dam is writing a program that: 1) has the user guess a number, and 2) tells the user how many guesses it took to get the correct
    9·1 answer
  • 4. When emergency changes have to be made to systems, the system software may have to be modified before changes to the requirem
    13·1 answer
  • (Package Inheritance Hierarchy) Package-delivery services, such as FedEx®, DHL® and UPS®, offer a number of different shipping o
    10·1 answer
  • Write a program that has the following String variables: firstName, middleName, and lastName. Initialize these with your first,
    7·1 answer
  • On a webpage, a _____ provides supplemental material such as social networking feeds and ads. Group of answer choices footer sid
    9·1 answer
  • Write a function named shout. The function should accept a string argument and display it in uppercase with an exclamation mark
    6·1 answer
  • Members of the sales team use laptops to connect to the company network. While traveling, they connect their laptops to the inte
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!