Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

problem1. The statement #include   is normally added at the beginning of a program. What is the purpose of this statement?

problem2. describe what is meant by explicit type conversion.

problem3. Determine the trace table for the following program:

1. //Program to illustrate arithmetic operations

2. #include

3. Using namespace std;

4.

5. int main() {

6. int ThisVal, ThatVal, ThisVal2;

7. const int TheVal = 5;

8.

9. ThisVal = 3;

10. ThatVal= 2 * ThisVal + 7 / ThisVal * TheVal;

11. ThisVal2 = ThatVal * ThisVal / 9 + 8;

12.

13. cout << “ThisVal = “ << ThisVal;

14. cout << “; ThatVal = “ << ThatVal << endl;

15. cout << ThisVal2 = “ << ThisVal2;

16.  cout << “; TheVal = “ << TheVal << endl;

17.

18. return 0;

19.  }

problem4. prepare a program that displays all the odd numbers from 1 to 100 on separate lines. Use for loop.

problem5. What is the output when the following code fragment is executed?

  char ch;
  char title[] = "Programming";
  ch = title[1];
  title[3] = ch;
  cout << title << endl;
  cout << ch << endl;

problem6. What is the least number of times the body of a while loop can be executed?

problem7. What is wrong with the following loop:

      While (n<=100)
      Sum += n*n;

problem8. prepare a program that reads the prices of zero or more items, and displays the total price with 14% sales tax added. (Hint: the program will know when the last price has been read if a price of 0.00 is entered)

problem9. prepare a program that reads in two floating point numbers and then performs one of four operations on them: addition, subtraction, multiplication or division. The program must ask the user which one of the operations to perform. Use a switch statement to perform the correct operation and display the result.

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M95908

Have any Question? 


Related Questions in C/C++

1 requirementsin this assignment you can unleash your

1. REQUIREMENTS In this assignment, you can unleash your imaginations and use OpenGL with C/C++ programming to produce a scene(s) that represents what you envision could possibly be seen under the sea. Please note that a ...

Programwriteacprogramthatwillasktheuserforthenameofaninputfi

Program Write a C++ program that will: Ask the user for the name of an input file. Read in this name and open that text file for input. Ask the user which of two options they want to do: Read in student data Count lines ...

Object oriented programmingassignmentq1 assuming there are

Object Oriented Programming Assignment Q1: Assuming there are 7.481 gallons in a cubic foot, write a program that asks the user to enter a number of gallons, and then displays the equivalent in cubic feet. Q2: You can co ...

Discussion questonsplease respond to all of the following

Discussion Questons Please respond to all of the following prompts: • How are input and output accomplished in C++? • How do cin and cout relate to ostream and istream? Lab Activity 1. Write a C++ program per the require ...

Write an application that allows the user to enter two

Write an application that allows the user to enter two variables: number (real) and code (character). Calculate the value indicated by the table below: If code is Result A symbol the whole part of the number everything e ...

More often than not entrepreneurs will fail several times

"More often than not, entrepreneurs will fail several times before they make it and will usually learn a lot in the process. To help these entrepreneurs to succeed will require a cultural shift. We need to encourage Aust ...

This program involves using stl listsfor this program you

This program involves using STL lists. For this program you will implement three functions whose prototypes are given below: list ::iterator mxIter(list ::iterator first, list ::iterator last); void selectSort(list & aLi ...

Question 1you are facing the following problem you are

Question 1 You are facing the following problem: You are given a robot and your task is to "guide" the robot through a 2-dimensional maze such that the robot can reach a desired goal state. Assume that the maze is define ...

Assignment simple 5-card poker gamein this assignment you

Assignment: Simple 5-Card Poker Game In this assignment, you will develop a simple poker game, complete with basic AI, using the object oriented programming principles discussed in class. Flow of Play Your poker game's p ...

Writeacprogramthatwilluseloopstoperformeachofthefollowingtas

Write a C++ program that will use loops to perform each of the following tasks: 1. Ask the user for two characters from the keyboard and read them into char variables. Determine which input is larger and which is smaller ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

A cola-dispensing machine is set to dispense 9 ounces of

A cola-dispensing machine is set to dispense 9 ounces of cola per cup, with a standard deviation of 1.0 ounce. The manuf

What is marketingbullwhat is marketing think back to your

What is Marketing? • "What is marketing"? Think back to your impressions before you started this class versus how you

Question -your client david smith runs a small it

QUESTION - Your client, David Smith runs a small IT consulting business specialising in computer software and techno

Inspection of a random sample of 22 aircraft showed that 15

Inspection of a random sample of 22 aircraft showed that 15 needed repairs to fix a wiring problem that might compromise

Effective hrmquestionhow can an effective hrm system help

Effective HRM Question How can an effective HRM system help facilitate the achievement of an organization's strate