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

WAP to calculate simple interest using class (Display principal, rate and time along with simple interest)

WAP to find Largest among 3 numbers using class (Display all the three numbers along with largest value)

Write a C++ program to create a base class called STUDENT (Name, Roll Number, Age) and using inheritance create classes UG student and PG student having fields as semester, fees and stipend. Enter the data of 5 students. Store each set of data to file. Find the average age, semester wise for all UG and PG students separately from file. (Assume at least two different values for the semester field for each of UG and PG classes). 


What is operator overloading? Explain this concept and provide a suitable example.

You are working as a computer engineer in a firm where your task for this week is to



model a Counter class in C++. You are asked to:



• Have a default constructor



• Have a constructor which should take an initial value of count



• Have a copy contractor



• Have a print function to print the count value



• Have a ++ increment operator overladed as prefix and postfix operator



• Have a -- increment operator overladed as prefix and postfix operator



• Have a destructor



Your task is to:



1. Draw the class diagram



2. Implement the class



3. Write the test code to test all the features of your class in the main program.

when the user enters three number show him true if the total of two numbers is equal to the third.


Write a program that prompts the user for number of students to process. The program will allow the user to enter the name of student and then it will ask for the number of marks for that student. The program will then prompt for each score and will calculate the average mark for each student. Make sure a structure ‘Student’ is defined. Use a function that prompts the user for the name of the student and number of test scores for that student. It stores the data into an array of type Student* and then returns that array. Use numTests[ ] array as an output parameter to store the number of tests for each student. This will then be passed to the display function. This function display marks and calculates the average for each student.


Sample Run:

Enter number of students: 1

Enter student 1 name: Jenny

Enter number of marks for Jenny: 2

Enter mark 1: 99

Enter mark 2: 88

=============================

Student 1: Jenny

Marks: 99 88

Average for Jenny is: 93.5%

=============================


Write a statement that calls the function IncreaseItemQty with parameters notebookInfo and addQty. Assign notebookInfo with the value returned.


#include <iostream>

#include <string>

using namespace std;


struct ProductInfo {

  string itemName;

  int itemQty;

};


ProductInfo IncreaseItemQty(ProductInfo productToStock, int increaseValue) {

  productToStock.itemQty = productToStock.itemQty + increaseValue;


  return productToStock;

}


int main() {

  ProductInfo notebookInfo;

  int addQty;


  cin >> notebookInfo.itemName >> notebookInfo.itemQty;

  cin >> addQty;


  /* Your code goes here */


  cout << "Name: " << notebookInfo.itemName << ", stock: " << notebookInfo.itemQty << endl;


  return 0;

}


Make a program that will input minutes and convert it into seconds. Your program will be terminated when you input zero in the minutes.


Make a program that will input Dollar currency, convert it into peso.

Peso= dollar currency*50.00 pesos.

Display the peso equivalent.

Your program will be terminated if the inputted Dollar currency = 0.


LATEST TUTORIALS
APPROVED BY CLIENTS