Questions: 11 448

Answers by our Experts: 10 707

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Write a program using standard wtring functions that accepts a price of an item and display its coded value. The base of key is:

X C 0 M P U T E R S

0 1 2 3 4 5 6 7 8 9


Sample Input/output Dialogue:

Enter Price: 489.50

Coded Value: PRS: UX


Write a program in C++ to generate the following pyramid of numbers.


0


1 0 1


2 1 0 1 2


3 2 1 0 1 2 3


4 3 2 1 0 1 2 3 4


5 4 3 2 1 0 1 2 3 4 5


6 5 4 3 2 1 0 1 2 3 4 5 6

Write a program in C++ to read a positive integer number n and to generate the numbers in the

following form.

For example,

Enter a number: 5

Output 5 4 3 2 1 0 1 2 3 4 5

Enter a number: 7

Output 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7


Overloaded insertion operator to display the Time in the form hr:min:sec. If hours, minutes


and/or seconds is a single digit, the time should be shown as 0x: where x is hours, minutes or


seconds. Example: 02:33:45, 13:05:66, 23:17:09

Write a program in C++ to read a positive integer number n from a standard input device and to display the number and digit. For example, n = 5678 Output 5 6 7 8 vertically


Write a program to implement the Date class which has three data members named day, month and year.

 

1.  Provide a constructor, which takes arguments (you may set values of data members to 0).

 

2.  Write getter and setter functions (input and show functions) for the Date class.

3.  Also write a member function void CompareDates(Date d1, Date d2) which tells which date comes first.

 

Example output:

13/11/2009 comes before 20/12/2009



Create a class named ‘Rectangle’, Triangle and Square.

Rectangle class:

                       Data Members: length, width and area

                       Functions:input() ,area_Calculator()

Square class:

                       Data Members: length,area

                       Functions :input() , area_Calculator()

Triangle class:

                       Data Members: base,hieght,area

                       Functions :Input() , area_Calculator()

Compare their areas in a friend function and tell which shape has greatest area.

Area of rectangle: length*width;

Area of triangle: ½(base*height);

Area of square: (length)2



Create a class named ‘CalculateArea’ to calculate the area of three different diagrams i.e. Rectangle, Triangle and a Square using function overloading.

First prompt the user to select the diagram for which he wants the area:

Press 1 for Rectangle

Press 2 for Triangle

Press 3 for Square

After the selected option, call the respective function of the selected diagram and print the area.

Area of rectangle: length*width;

Area of triangle: ½(base*height);

Area of square: (length)2



Write a program that creates a class called student. The data members of the class are name and age.

·      Create a nullary constructor and initialize the class object.

·      Create a parameterized constructor that can set the values being passed from the main function.

·      Create a display function called showall( ) which will be used to show values that have been set.

Use the default copy constructor to show that copying of simple objects can be accomplished through the use of the default copy constructor.


Write a C++ program to enter salary and output income tax and net salary using multiple inheritance concept.

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS