Write the code above using a repeat loop.

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

1. What is the value of the expression (x OR y) AND z if x = true, y = false and z = false?

Answer:

2. What is the final value of y after executing the following code:

int y = 0;
int x = 1;
while(x<5)
{
y = y + 2*x;
x = x+1;
}

Answer:

3. Write the code above using a repeat loop.

Answer:

4. Write the code above using a for loop.

Answer:

5. What is the final value of x after executing the following code:

int x = 10
if (x>10)
{
x = x * 3;
}
else
{
x = 2*x;
}

Answer:

6. If x = 2 and y = 3 what are the values of the following expressions?

a. (x + y * 2)/4 + 4

b. (y - x) * 3 + (x + y) * 2

Answer:

7. How many times does the following loop execute?

int x = 8;
do
{
cout<<"this is a message"<<endl;
x--;
}while(x!=0);

Answer:

8. What is the output of the following code? Show your work with each of the 3 variables.

int x = 0;
int y = 1;
int total = 0;
while(x<=3)
{
y = y+x;
total = total + y;
x = x+1;
}
cout<<"Total is "<<total<<endl;

Answer:

9. What C++ statement would you use to print the phrase "CMIS102A" three times in a new line?

Answer:

10. How many times in the following C++ code will "CMIS 102" be written to the standard output?

for (int i = 1; i<=3; i++)
for( int j = 1; j<=i; j++)
cout <<"CMIS 102"<<endl;

Reference no: EM13938476

Questions Cloud

Users glean from an analysis of the statement of cash flows : Referencing this week’s readings and lecture, describe the following terms as they relate to the statement of cash flows: cash, operating activities, investing activities, and financing activities. What can creditors, investors, and other users glean..
Morally wrong to have a blow-dry : Is it normal to get fewer followers the more you tweet? Is technology now the fiDh element? Or is that wood?
Current cost of common equity for the firm : Underestimated Inc.’s common shares currently sell for $40 each. The firm’s management believes that its shares should really sell for $49 each. The firm just paid an annual dividend of $2 per share and management expects those dividends to increase ..
Description of the e-commerce project : Drawing on this description of the e-commerce project you are required to produce a series of documents that address the main activities and milestones of the initiation ,planning and control phases of project management.
Write the code above using a repeat loop. : What is the final value of y after executing the following code:
About the reduce working capital : Your firm is contemplating the purchase of a new $605,000 computer-based order entry system. The system will be depreciated straight-line to zero over its five-year life. It will be worth $65,000 at the end of that time. You will save $235,000 before..
How is interest computed on interest-bearing short-term note : How is interest computed on an interest-bearing short-term note? When would debt that must be repaid within the next year be classified as long- term instead of current?
Why do think lyrica has such a broad range of side effects : Lyrica has a very broad range of side effects associated with its use, including dizziness, blurred vision, euphoria, changes in appetite, dry mouth, vomiting, tremors, and others. Why do you think Lyrica has such a broad range of side effects?
What is your monthly mortgage payment : You borrow $165,000 to buy a house. The mortgage interest rate is 7.5 percent and the loan period is 30 years. Payments are made monthly. What is your monthly mortgage payment?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Develop a two dimensional interactive game

The player starts as a disk, but can "morph" (that is expand and contract) in selected directions

  Create a program that will round a floating point

Create a program that will round a floating point value to a specified number of decimal places as input by the user. To perform the actual calculation, write a function that takes the user's value and the number of decimal places as input paramet..

  Design an employee class that has fields for name

Design an Employee class that has fields for the following pieces of information: Employee Name and Employee Number

  Demonstrate the construction and output of an array

In fluid mechanics, the Reynolds number (Re) is a dimensionless quantity that is used to help predict similar flow patterns in different fluid flow situations. For example, Reynolds numbers can be computed for different velocities of fluid flow over ..

  Create huffman codes

Write a C++ program to create Huffman codes. Program input is a file called freq.txt (make up your own file for testing) that contains data on the characters in some cleartext file in the form of each character's non-zero frequency of occurrence i..

  Create a class named realtorcommission.

Create a class named RealtorCommission. Fields include the sale price of a house, the sales commission rate, and the commission.

  Create an array of 12 structures to hold weather of yearl

Input validation: only accept temperatures within the range between -100 and +140 degrees Fahrenheit.

  Write a program using above data file

Write a program using above data file (must prompt user for file names- input and output) to read in the critical path information and write reports.  Print reports (3 reports) to an output file as below:Print a project completion timetable that list..

  Using which of the following techniques in c++

Using which of the following techniques in C++ is it possible to have different functions with the same name?select all that apply

  Calculate the weekly salary of a worker

Write a program to calculate the weekly salary of a worker. Ask the user for the pay per hour for weekdays, and pay per hour on weekends. Then ask user for number of hours worked for each day of the week (i.e. Mon, Tue, … Sun).

  Initialize an array and fill the array with the gpa values.

Write a program in java that asks user input (using a loop) for name of 10 student and the corresponding grade point averages (GPAs). Initialize an array and fill the array with the GPA values.

  Define the cheetah constructor to accept and initialize

Design and implement a class called Cheetah that contains instance data that represents the cheetah's name, age, weight, length and gender.

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