C++ Answers

Questions answered by Experts: 9 913

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

1) Write a C++ programme which demonstrate static binding and dynamic binding.

2) Write a C++ programme which demonstrate vitual destructor.


1) Write a C++ programme which demonstrate single inheritance and multiple inheritance.

2) Write a C++ programme which demonstrate hybrid inheritance and multilevel inheritance.


1) Write a C++ Program to swap data members of two objects of a class using friend function.

2)Write a C++ program to demonstrate friend class.


1)Write a programme in c++ to Overload << operator using friend function.


2)Write a programme in c++ to Overload >> operator using friend function.


Create a class called Stack for storing integers. The data members are an integer array for storing



the integers and an integer for storing the top of stack (tos). Include member functions for initializing tos



to 0, pushing an element to the stack and for popping an element from the stack. The push() function



should check for “stack overflow” and pop() should check for “stack underflow”.

write a c++ program about this "Compute the final grade, the user will supply the recitation, exam, project, and attendance grade. Recitation is 15%, Exam is 35%, Project is 20% and Attendance is 30%. Final grade will be the sum of recitation, exam, project and attendance after getting the corresponding percentages."


Write a C++ program which accepts amount in rupees as input (integer) within Range from

Rs. 100 to Rs. 100000 and then asks the user for particular currency note preference and display the total

number of currency notes of Rs. 500, 100, 50, 20, 10, 5, and 1. The user can be given a maximum of 200

notes of his preferred choice. (5 marks)

For example: when a user enters a number, Rs. 57477 and enters 50 notes as his preferred choice, the

results would be like this.

Currency Note : Number

500 : 94

100 : 4

50 : 200

20 : 3

10 : 1

5 : 1

1 : 2


Using switch-case statements only, write a C++ program that displays the following menu for

the food items available to take orders from the customer: (10 marks)

● Burgers

● Pizzas

● Sandwiches

When the user selects one of the options, a further submenu is displayed according to the chosen option.

The online food shop offers Crispy Chicken Burger (600 Rs.), Beef Burger (650 Rs.), and Fish Burger (700

Rs.) in the Burger category; Chicken tikka, Chicken Fajita and Four Seasons in the Pizza category; whereas

Club (300 Rs.), Chicken (325 Rs.), and Vegetables (315 Rs.) in the Sandwiches category. Prices of each food

item is also displayed to the user in the selected sub menu. The user will select the food item and quantity

of the item. In case of the Pizza items, the user can also select the size of pizzas (i.e. Small (850 Rs.),Medium (1200 Rs.), and Large (1600 Rs.)). The program outputs the total charges according to the chosen

options.


IFone, a cellular company, offersthe following three postpaid data packages to its customers.

(5+5 marks)

● Package A: For Rs. 100 per month, 1 GB data is provided. Additional data can be purchased for

Rs. 20 per 100 MB.

● Package B: For Rs. 200 per month, 2.5 GB data is provided. Additional data can be purchased

for Rs. 10 per 100 MB.

● Package C: For Rs. 1000 per month, unlimited access is provided.

Part A: Write a program that calculates a customer’s monthly bill. It should ask how many GBs the

customer has used in the month and which package the customer has subscribed for. It should then

display the total amount due.

Part-B: Modify the program in Part A so that it also displays how much money Package A customers

would save if they purchased packages B or C, and how much money Package B customers would save if

they purchased Package A or C. If there are no savings for a particular package, your program shall print

an appropriate message.


You are given a 9*9 grid as shown in the figure below. You can determine the color

of each square from the grid. The number of each square is also shown below. Write a C++ program for

this below given grid. The user is given two options to select from.

Part A: When the user selects 1st option, the user will enter number of square in this grid (any

number from 1-81). Your program will determine the color of the square.

Part B: When the user enters 2nd option, the user will enter two numbers from this grid. Your

program will determine if the two squares entered in this 9*9 grid have same color or not.


LATEST TUTORIALS
APPROVED BY CLIENTS