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
Which model allows you to make subsystems in parallel?
boyakko [2]
The model is Parallel Distributed Processing Model (PDP) wherein m<span>Memory results from weblike connections among interacting processing units operating simultaneously, rather than sequentially ( also known as the connectionist model).</span>
8 0
3 years ago
Give two reasons why it is important to upgrade your browser when a new version becomes available.
kupik [55]
1. Higher speed
2. New features
3. Less bugs
4. Upgrades
4 0
3 years ago
What does =SUM(B2:B6) mean
dedylja [7]

In Excel the sum B2 and B6 simply means that B2 and B6 Numbers are adding to get a Sum, it actually like the normal Calculator, but in Excel it helps to do the calculation of your your data simple and easy, there is no hard work.

8 0
3 years ago
A database that is created and maintained using services such as Microsoft Azure or Amazon AWS is called a(n) _____ database.
Phantasy [73]

Answer:

It is called a cloud database

5 0
2 years ago
Simon is working with his school newspaper to create the front page. What software is best used for page layout design?.
svlad2 [7]

Answer:

Adobe Indesign.

Explanation:

Adobe indesign is a typesetting and desktop publishing application used to create posters, newspapers, flyers, brochures, magazines, presentations, book and ebook etc.

It is a package from the Creative cloud adobe system packages. It has predetermined templates for newspaper pages (if newpaper is to published), and plug-ins to further customize the the layout of the newspaper to be created or published.

3 0
3 years ago
Other questions:
  • Why is it a mistake to put e-mail address of people who don't know each other in the "to:" field
    9·2 answers
  • How can people make sure they are using credit cards responsibly
    14·2 answers
  • Write the percentage 5 1/4 as a decimal​
    8·1 answer
  • Company policies require that all network infrastructure devices send system level information to a centralized server. Which of
    6·1 answer
  • If an author is creating a reference list and wants the second and succeeding lines indented for a reference, they should select
    13·2 answers
  • Match each type of software license with the appropriate definition.
    11·1 answer
  • Write the WordSandwich method allSandwiches. This method creates and returns a new array of String objects as follows. Each elem
    13·1 answer
  • Edhesive 3.5 code practice quetion one
    9·1 answer
  • The quickest way to change a word is to double
    11·1 answer
  • Which code block is an example of a motion block in scratch?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!