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++

Programming cc assignmentsyoull need to download this to

Programming C/C++ assignments You'll need to download this To write the program. The programs will be written using the Microsoft Visual C++ Express Edition IDE (Integrated Development Environment), which can be download ...

A compiler that translates a high-level language into

A compiler that translates a high-level language into another high-level language is called a source-to-source translator. What advantages are there to using C as a target language for a compiler?

1 write a c program that includes a function called lobster

(1) Write a C program that includes a function called lobster() that accepts three arguments: a character and two integers. The character argument is the character to be printed by lobster(). The second argument is the n ...

Discussionkeyboard versus file input please respond to the

Discussion "Keyboard versus File Input" Please respond to the following: • Suppose you are designing a C++ application that needs to capture user input specifically via a keyboard or from a file. Determine the method tha ...

Assignment part acreate a checkbook program using c

Assignment (part a) Create a Checkbook program using C : • Create a Check structure. Include:   o Check number (should be an integer).   o Date (use type char[ ]).   o To   o Amount   o Description • Add functions to:   ...

Assignmentinstructionsthis assignment is to implement your

Assignment Instructions This assignment is to implement your own mini-grocery store in C++. Suppose you have the following Food hierarchy: FOOD FRUIT APPLE BANANA GRAPE DAIRY MILK YOGURT CHEESE (your choice) (three items ...

Modules in c are called functions c programs are typically

Modules in C are called functions. C programs are typically written by combining user created functions as well as "pre-packaged" functions found in the C Standard Library. For instance, printf() is a function that is fo ...

Intro to programming in c programming assignmentassignment

Intro to Programming in C Programming Assignment Assignment purpose: User defined functions, pointers, Menu driven program A Company needs to create software for their new line of phone applications. Customers will have ...

Write a program to draw a symmetric shape of your own using

Write a program to draw a symmetric shape of your own using C++ user-defined functions and arrays. The program should draw a shape in its original and opposite forms (black and white and then white and black). Please con ...

Assignmentthis assignment gives you the opportunity to

Assignment This assignment gives you the opportunity to practice array of pointers, linked lists and self referential structures. Write a program that initializes two parallel arrays as follows: char * String[] = { "Abbi ...

  • 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

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen