What is printed by the following program

Assignment Help C/C++ Programming
Reference no: EM13339808

What is printed by the following program? Suppose the input is:
Miller
34
340
#include <iostream>
#include <string>
using namespace std;
const int PRIME_NUM = 11;
int main()
{
const int SECRET = 17;
string name;
int id;
int num;
int mysteryNum;
cout << "Enter last name: ";
cin >> name;
cout << endl;
cout << "Enter a two digit number: ";
cin >> num;
cout << endl;
id = 100 * num + SECRET;
cout << "Enter a positive integer less than 1000: ";
cin >> num;
cout << endl;
mysteryNum = num * PRIME_NUM - 3 * SECRET;
cout << "Name: " << name << endl;
cout << "Id: " << id << endl;
cout << "Mystery number: " << mysteryNum << endl;
return 0;
}

Reference no: EM13339808

Questions Cloud

What is the depth of the flow in the channel during periods : Due to concerns about the salt water content in the estuary, the discharge in the channel needs to be varied to mimic tidal effects. This means that for 12 hours a day, the channel needs to carry a flow of 8m3.s1, and for the other 12 hours the fl..
Write a c++ statement that multiplies the value : Write a program that prompts the user to input a decimal number and outputs the number rounded to the nearest integer.
How much work is done by the electric field as third charge : how much work is done by the electric field as a third charge q3 = +2.19 nC is moved from point a to point b. (q1 = +9.41 nC, q2 = -9.41 nC)
Derive drag coefficient for f14 at max thrust and airspeed : Wingspan 64 m spread, 38 m swept Total Wing area Aw = 54.5 m2 Drag profile area Ap = 11.5 m2 Mass 27,700 kg fully loaded 2 x GE F110 Turbofan engines Thrust 61.4 kN from each engine
What is printed by the following program : What is printed by the following program?
What is the initial momentum of the offensive player : A football player who weighs 85 kg is carrying the ball directly up field at a rate of 15 km/hr. What is the initial momentum of the offensive player
What is the firms total profits : If the above monopolist were to behave like a perfectly competitive firm (operating in the long run), determine its output.
Mark the following statements as true or false : Mark the following statements as true or false.
Industry price and output will approach the outcome for : Assume the firms in an oligopoly produce a differentiated product and are initially colluding. If each firm begins to cheat (to increase sales) by underpricing the other firms, as the amount of cheating increases, the resulting industry price and out..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Ohio phonebook has gotten mixed up

In an accident, the Ohio phonebook has gotten mixed up. The names are now really out of order. You and your enthusiastic, but naive, assistant Carl must fix the problem. No one can use the phonebook while you are sorting it, so every extra second of ..

  Describe how an element in an array is accessed in memory

Describe how an element in an array is accessed in memory. For example, where is myArray[25] stored in memory?

  Declare a vector

Declare a vector of these structures where the size of the vector is to be 7.

  Write a function integerpower

Write a function integerPower(base, exponent) that returns the value of base^exponent. For example, integerPower(3, 4) = 3* 3 * 3* 3. Do not use any math library functions.

  In competitive tournament

In competitive tournaments, it is common for all the players or teams to play in a series of matches in order to determine a single winner of the entire tournament. However, a number of different tournament formats exist. Here, we will concern our..

  Write an algorithm that converts a decimal number

Write an algorithm that converts a decimal number between 0 and 15 into its 4 bit unsigned binary representation and write an algorithm that converts a linear measurement in feet and inches into meters. One inch is equivalent to 2.54 centimeters.

  Show the contents of the id array

Show the contents of the id array after each union operation when you use the quick find algorithm (Program below) to solve the connectivity problem for the sequence 0-2, 1-4, 2-5, 3-6, 0-4, 6-0, and 1-3.

  Write and test a function to calculate the sum of the series

stop accumulating the sum when the term to add or subtract becomes smaller than a given small number(precision) oassed as an argument.

  Write a program in c of fibonacci series

Write a program in c of fibonaci series with and without using fibo func, both

  Write a program that stores the number

Write a program that stores the following numbers in the array named miles : 15, 22, 16, 18, 27, 23, 20. Use a pointer to copy the data stored in miles to another array named dist and then display the values in the dist array.

  The grid is populated randomly

Initially, the grid is populated randomly with occupied and empty cells. Once the initial grid has been created, the program loops. Each iteration of the loop represents a tick or time step in the environment.

  String converter

String Converter: Implement a program that asks the user to input up to 20 strings (stopping when the user inputs 0). Store these strings in a 2-dimensional array. Replace all the characters that are upper-cased to their lower-case equivalent.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd