Please correct the errors with replacement lines

Assignment Help C/C++ Programming
Reference no: EM13938609

Please correct the errors with replacement lines beside it. And then give short notes on why it is wrong.

The code is attached.

1) Please correct the errors with replacement lines beside it. And then give short notes on why it is wrong.

class Person
{
private:
char name[30];
int age;

public:
Person (string, int);
int setage (int);
int setname (char *);
void show (void);

};

void main()
{
Person a_group [5];
int i;

for (i=0; i<6; i++)
a_group[i].setage(i+1);

for (i=0;i<6;i++)
cout << "Person " << i+1 << " is " << a_group[i].age << end1;
}

2) Please correct the errors with replacement lines beside it. And then give short notes on why it is wrong if the below codes replace the codes between the two === in 1):

void main (void)
{
Person a_person;
a_person.age = 99;
}

Reference no: EM13938609

Questions Cloud

Mobile device security : Suggest three (3) benefits that organizations can gain from deploying a Mobile Device Management (MDM) security solution. Additionally, suppose that an organization chose not to deploy an MDM solution. Determine what you believe to be the major risks..
What did dennis stevens mean by a silent deal : Name and then describe the theory that Laub and Sampson developed. What did Dennis Stevens mean by a "silent deal"? What is "bulletproof software" and who developed it? Discuss Thornberry's views on delinquency
What is the weighted cost of capital for el suezo : Weighted Average Cost of Capital and Economic Value Added El Suezo Inc. What is the weighted cost of capital for El Suezo? Calculate EVA for El Suezo.
Theory of creep and viscoplasticity : Principles associated with the theory of Creep and Viscoplasticity need to be identified and your understanding of these principles. Graphs, tables, calculation etc should be included for better illustration.
Please correct the errors with replacement lines : Please correct the errors with replacement lines beside it. And then give short notes on why it is wrong.
Which symbol would be used in a flowchart : Which symbol would be used in a flowchart for the following statement?Read customerName
What is the meaning of negative residual income or eva : What is residual income? What is EVA? How does EVA differ from the general definition of residual income? Can residual income or EVA ever be negative? What is the meaning of negative residual income or EVA?
Describe the nature of decalcified bone : Two common blisters of the integument are watery blisters, filled with a clean fluid, and blood blisters, filled with blood. Based on your knowledge of the blood supply to the integument, describe what layer might be damaged in the these two blist..
Complete the anatomy of my computer table : Complete the Anatomy of My Computer table below. In order to gather the information you can look at your computer's documentation or go to the manufacturer's website and search for your computer. Include your findings in the cell to the right of the ..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a driver to thoroughly test your implementation

Write a driver (SortedListArrayDriver) to thoroughly test your implementation. Part of your grade  will depend on evidence of testing. Note that it is not necessary to provide user interaction in your driver class for this program

  Implement the default constructor

Implement the default constructor and the constructors with one and two int parameters. The one parameter constructor should initialize the first member of the pair; the second member of the pair is to be 0.

  Write a small program to simulate a raffle

Write a small program to simulate a raffle (a gambling game) for a group with 100 members. You can simply identify each member with a no-duplicated ID numbers from 01 to 100. A number ticket with a positive 4-digits integer number will be randomly cr..

  After the array is created and loaded

After the array is created and loaded, the problem is then to sort the array and print out the contents of the sorted array. Please use a separate function for the sort routine and also a separate function for the print out of the array.

  Main function to input twenty integers in given range

Write a main function to input 20 integers in range of 1-6, function should count number of times the numbers 2 and 5 occur. function must declare statics variables count2 and count5.

  Conversion of programming languages

How to convert java proram into C++ program.

  Make program using switch statements in visual basic/c++

Enter the year code, course code, number of units and output the year name, course name, tuition fee and the balance tuition fee of the student.

  What is the difference between a while loop and a do while

Every switch statement can be rewritten as a series of nested if statements. Is the reverse true? Give an example of a set of nested loops that could not be implemented as a switch statement?

  A c++ program using the concept of function overloading

write a c++ program using the concept of function overloading for the following options : select the options from [1-3], 1- Area of rectangle 2- Area of square 3- Exit ,

  Write a program that will read input and write it back out

Write a program that will read input, and write it back out, character by character. Propend each line of input with a line number.

  Calculate the gross pay of a set of employees

Write a C program that will calculate the gross pay of a set of employees - For each employee the program should prompt the user to enter the clock number, wage rate, and number of hours

  Write program which reads n numbers from keyboard

Write down C++ program which reads N numbers (positive, negative, integer and double numbers) from keyboard, computes and shows the following information. Largest number of all numbers entered from keyboard.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd