Ask Question, Ask an Expert


Ask C/C++ Expert

Home >> C/C++

problem 1) Define the class Counter having an attribute value. Provide a constructor which initializes value to zero. Also give following methods:

a) Increment (): that increment the value by one.

b) Decrement (): that decrement the value by one.

problem 2) Define the function Reset which takes a Counter type object as input and resets its value to zero. Make this function a friend of Counter class

problem 3) Define the class Student that has following attributes:

Name: allocated dynamically by a character pointer.

Rollno: an integer.

Marks: a double type array of 5 elements.

Percentage: a float

Include the constructor which takes values of Name, Rollno and Marks from user as input.

Also include following methods:

find outPercentage: It adds all 5 elements of array Marks and compute percentage according to formula Percentage =(Total marks/500)*100 and stores result in member variable Percentage.

Grade: It calls find outPercentage method and displays grade accordingly

prepare the driver program to test your class.

problem 4) prepare the program which takes the record of 10 students from user in the array and display all records.[use Student class, defined Q3]

problem 5) Define the pointer to student class to access contents of array defined in Q4. Allow user to search a record in array by means of Rollno

problem 6) Develop the class to represent the integer array. The member variables include an integer to represent the size of array and an integer pointer to represent the address of the first element of the array. The user is allowed to create the array at runtime using this class. Include suitable constructors (parameterized and copy). Also include the method which adds the contents of array.

C/C++, Programming

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

Have any Question? 

Related Questions in C/C++

For this program you will add and test 2 new member

For this program you will add and test 2 new member functions to the IntSLList class posted on the website. The two member functions are: insertByPosn(int el, intpos) Assuming that the positions of elements of a list beg ...

Please use codeblockslist the program and the output on the

Please use codeblocks List the program and the output on the command line Eg #include #include using namespace std; int main() { floatjohno = 0.5; size_t size = 24; vector array(size); for(inti=0; i     { johno = johno + ...

Ipo chartinputprocessingoutputmarks for four

IPO Chart Input Processing Output Marks for four courses Processing Item: Grade Point and Grade for individual course Overall GPA Algoritham Initialize gp with zero Repeat  for (each course)                 Enter the mar ...

Text exercise 413 gas mileagebulldrivers are concerned with

Text Exercise 4.13 (Gas Mileage) • Drivers are concerned with the mileage obtained by their automobiles. One driver has kept track of several trips by recording miles driven and gallons used for each trip. Develop a C++ ...

Programming assignment-1 program specification1 your

Programming Assignment- 1. Program Specification 1. Your program must read 8-bit ASCII strings from standard input -- for instance, using the cin object in C++, or stdin in C. You must consume all input from standard inp ...

1 learner objectivesat the conclusion of this programming

1. Learner Objectives: At the conclusion of this programming assignment, participants should be able to: * Apply repetition structures within an algorithm * Construct while (), for (), or do-while () loops in C * Compose ...

1 write a program to find the sum amp average of the given

1) Write a program to find the sum & average of the given numbers using the while loop. 2) Write a program in C to find the sum and average of the given numbers stored in an array of n values.

C program assignmentaccording to C Program Assignment According to

C Program Assignment According to, the great circle distance based on two coordinates in nautical miles is given by: d = r * Δσ where r is the radius of the earth and Δσ ...

Computer programmingobjectives1 opening a file reading from

Computer Programming Objectives: 1. Opening a file, reading from file, writing to a file and closing a file. 2. Sequential access files handling. 3. Practice C++ programming problems. Note: Carefully read the following i ...

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

  • 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