Write a complete program that declares an integer variable, reads a value from the keyboard into that variable, and writes a single line to standard output consisting of the variable's value, twice the value, and the square of the value, separated by single spaces. Besides the numbers, nothing else should be in the line written to standard output except for the spaces separating the values.

Answers

Answer 1

// making the variable

int variable = 0;

// input variable

cout << "Enter the value of variable : " <<endl;

cin>>variable;

// statement for out put

cout << " Value is : " << variable << "," <<"Twice value is : "<< 2(variable) <<","<<"Sqaure is " << variable * variable <<"."<<endl;


Related Questions

An administrator has created a new custom object in a sandbox environment and now is ready to deploy in production. How can the administrator ensure that the field-level security that was tested and approved in the sandbox environment is maintained as part of the deployment? a) Create a change set that includes the custom object and all custom fields b) Create a change set that includes the custom object and all profiles c) Create a change set that includes the custom object, check the retain field-level security option d) Create a change set for the custom object; use Data Loader to transfer field-level security

Answers

Answer:

Option D

Explanation:

Option A is rejected because adding a custom object will cost both in memory and computation power. Consider that you have 1 million users, than there will be 1 million custom objects in the memory for checking the security which is not good.

Option B is not answer because again making a custom object will cost in memory and computation power.

Option C is not good because it also makes the custom object.

Option D is selected because change sets can be made which will not cost as much as the other options are costing. Also Data Loader can have come credentials defined in it which we can use to check if the user activities are according to the rules at each level.These days these data loader object technique is used because there will be static change sets for the class of users to check security.

Compose a C++ function named getSpeed that uses a reference parameter variable named speed to accept an integer argument. The function should prompt the user to enter a number in the range of 20 through 70. The value entered by the user should be validated and stored in the parameter variable. Set the parameter variable to zero if the user enters a number outside the range of 20 through 70. void getSpeed (int &speed) { Cout << “Enter a number in the range between 20 and 70” << endl; Cin>>speed; If ( speed <=20 || speed >= 70) Speed = 0; }

Answers

// Making the function

void getSpeed(int &speed){

// initialize the variable to take input

int input =0;

cout << " Enter the Number in range of 20 through 70 : "<<;

cin>>input;

// validate the input

if(input>=20 && input<=70)

 speed = input;

else

 speed = 0;

}

Assume that two int constants,FIRST_YEAR and LAST_YEAR have already been declared and initialized with year values (like 2009, 2014), along with a double variable oil that has been initialized with the number of barrels of oil consumed in Canada in the year given by FIRST_YEAR. Write some code that uses a while statement to print on a line by itself, each of the years from FIRST_YEAR to LAST_YEAR inclusive. On each line, after the year, separated by a colon and a space, print the new value amount of oil, taking into account that each year the oil consumed increases by 20%.

Answers

// While loop

while(FIRST_YEAR < LAST_YEAR)

{

cour<<"Year : " << First_YEAR << " Oil consumed is : " << oil <<"."<<endl;

FIRST_YEAR+=1;

// calculate the 20% increase

oil = oil + (oil *.20)

}

_______________, such as BASIC, Python, Java, Prolog, and C , make the programming process easier by replacing unintelligible strings of 1s and 0s or cryptic assembly commands with understandable commands, such as PRINT and WRITE.

Answers

Answer:

High level Languages

Explanation:

High level languages are made so that the byte code, Assembly code that computers can understand should be converted into a higher level human understandable languages such as Python,C++. Also, remember that the compilers of these languages such as Visual studio ultimately converts the high level code into low level code ( Assembly code ) that computers can understand.

Other Questions
Write a chemical equation for the reaction that occurs in the following cell: Cu|Cu2+(aq)||Ag+(aq)|Ag Express your answer as a balanced net ionic equation. Identify all of the phases in your answer. Classify the organisms based on whether they follow the Camegie stages of development PLEASE DO 41 AND 45!!!!!! Which is not a question you would typically ask yourself as you analyze the information on a website?a. Which details support the main point?b. Does this site contain too much information?c. What is the main point being made?d. What is the topic? Rock Corporation acquires all of the assets of Stone Corporation using only its voting stock. Stone Corporation distributes the Rock stock to its shareholders pursuant to its liquidation. After the acquisition, Stone Corporation's shareholders own 20% of the Rock stock (by voting power and value). The transaction is classified as a: 1. Define the term disproportionation reaction. 2. Write the balanced equation for the conversion of 4-chlorobezaldehye into 4-chlorobenzyl alcohol and 4-chlorobenzoic acid. 3. What is the oxidation number of the aldehyde carbon in each product of the Cannizzaro reaction? Show all work for credit. 10. Sarah is planning to fence in her backyard garden. One side of the garden is 34 feet long, another side is 30 feet long, and the third side is 67 feet long.Find the perimeter of Sarahs garden to determine the amount of fencing material needed.A.262 ft.B.68,340 ft.C.250 ft.D.131 ft. Someone is sniffing near Grumpys front door. Can you help Grumpy identify the Ragdoll in this picture!(Sorry if I chose the wrong subject, I dont know what the subject of this question is) Portfolio A has a beta of 1.0 and an expected return of 22%. Portfolio B has a beta of 2.0 and an expected return of 17%. The risk-free rate of return is 2%. Is there an opportunity for arbitrage: (Please explain your answer) 30 POINTS! Consider the system of linear equations and the matrix equations below.What is the value of x in the equation? Which statements accurately describe the function f(x) = 3 sqrt 18? algebra II engenuity what is 240,567 divided by 67 is 3590 What do you mean by preemptive and nonpreemptive multitasking and multithreading ? How long have sharks been around for? There are many different kinds of sweeteners: white sugar, brown sugar, sucanat, honey, maple syrup, Splenda, aspartame, stevia. Which one is the best for you? Why do living things have different water-body content? A woman spent most of her life working in the fields of her families soybean farm. She began experiencing strange symptoms in her twenties that developed into major neurological disabilities by the time she was 50. Doctors told her the symptoms were the results of working with the fertilizers and pesticides for so long. This is an example of which of the following? Select one: a. acute effect of exposure b. chronic effect of exposure y = x 6 y = x 4 solve the system of equations using substition. HELP NEEDED IMMEDITLY!!!!!!!! is 36a^2-9 a difference of squares? a. yes b. no Thirty-year-old Alayna is painfully shy and so sensitive to rejection that she rarely talks to people other than her coworkers and her family members. Occasionally, a man asks her out, but she tend to refuse. She spends a good deal of time reading and writing in her diary about her loneliness and other feelings. According to Erikson's theory, Alayna is facing the psychosocial conflict of _____ and is likely to develop _____.