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]
4 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]4 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
Two time series techniques that are appropriate when the data display a strong upward or downward trend are ___________ and ____
VMariaS [17]

Answer:

adjusted exponential smoothing; linear regression.

Explanation:

A time series can be defined as a technique used in statistical analysis and it involves indexing sets of data elements in a timely or successive order i.e sequentially.

Two time series techniques that are appropriate when the data display a strong upward or downward trend are adjusted exponential smoothing and linear regression.

An adjusted exponential smoothing is a statistical technique used for forecasting through the calculation of the weighted average of an actual value.

5 0
3 years ago
You are concerned about attacks directed at your network firewall. You want to be able to identify and be notified of any attack
Strike441 [17]

Answer:

Intrusion Prevention System (IPS)

Explanation:

Firewall can be defined as a network security device that monitors incoming and outgoing network traffic and decides whether to allow or block specific traffic based on a defined set of security rules.

Simply stated, a firewall is a network security protocol that monitors and controls inbound and outbound traffic based on set aside security rules.

A firewall is used to control access to a computer or network, as it creates a barrier between a computer or a network and the internet in order to protect against unauthorized access.

Basically, it is a network security device or security system pre-installed on most computers to essentially inspect data being transmitted to or from a computer

Thus, the tool you should use is an intrusion prevention system (IPS).

6 0
3 years ago
Martha is a healer, a healthcare provider, and an experienced nurse. She wants to share her daily experiences, as well as her 12
STALIN [3.7K]
The answer to the question is blog.
4 0
4 years ago
Read 2 more answers
Can someone write this in java? Also, does anyone know how to do Edhesive assignments?
svetoff [14.1K]
No I don’t know what are you saying can you explain or I’m here for points heheheh and Java is written in any way
7 0
3 years ago
Music = ("rap", "hip hop", "gospel")
astraxan [27]
Music = (“rap”, “hip hop”, “gospel”)
Country = (“country”,) #make sure that comma is outside of quotes
New_music = music + Country
print(New_music)
#var can be whatever you want
output:
(“rap”, “hip hop”, “gospel”, “country”)
4 0
3 years ago
Other questions:
  • 1. Mobile devices have a _________ viewport that displays a web page content that fits within a mobile screen.
    11·1 answer
  • The analysts at Techno Info Systems are considering the four-model approach to system development for a new client. If they make
    12·1 answer
  • Alkane is a Variety of which fruit
    6·1 answer
  • Enter the value of 5⋅(13.5−4.5). <br> ​
    5·1 answer
  • Mike wants to build an amplifier. which technology can he use?
    6·1 answer
  • What is the purpose of a mail merge field.
    14·1 answer
  • Jonathan is eight years old and is a participant in a study assessing the eating habits of schoolchildren. To assess the childre
    5·1 answer
  • When you cut and then paste a file, what are you doing?
    7·2 answers
  • In critical thinking, an argument is:
    12·2 answers
  • The ______ Works on a single variable or constant. *​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!