Teachers.Net
JoinLog in
Teachers.Net
Lesson Bank

Lesson #2448

Program in c++

By james t owens

https://teachers.net/lessons/2448.html

Program in c++

By james t owens

  • Advanced
Modernized edition

Teachers.Net edited this contribution for clarity, formatting and readability.

Grade / level
Advanced
Activity time
one day
Materials
to write out the program for me
Concepts / topics
Classes, get andset functions names, majors, and number of credit they are taking this semester
Activity Time
one day
Materials
to write out the program for me
Concepts / Topics
Classes, get andset functions names, majors, and number of credit they are taking this semester

Lesson Summary

it should contain data members for the student name,major,andnumber of credits for this semester, none of which should be accessed out side of the class.

1)you are goingto make a list of students for advisors. you will list the names,majors,and nnumber of credits they are taking this semester. if any student has registered for 20 or more credits, you will note that at the bottom of the list.
2)createa class hader file for a student. it should contain data members for the student name,major,andnumber of credits for this semester, none of which should be accessed out side of the class.
3)it should also include set and member function for each of the 3 data members.
4)it schold also include a member function that will print out all the data members setting the widths for 3 colums of data. the name and major should line up on the left and the number of credits should line up on the right.(see output below)
5)the header file should be documented with a paragraph describing it and documentaton through out describing the function and lines of code.
6)create a program file that will declare an array of student objects. the size should be defined as a constant variable and set to 3 for our exercise.
7)the program should loop to input from the user the name ,major,and number of credits for each student. it will then use the set member function
ti fill up the data members of that student.
8)it will then print the heading student list. it will then use another for loop to call each object's print function(see output below)
9)it will then use another for loop to get the number of credits for each student object, and if it is 20 or more print a note out a few lines down telling the name,major,and number of credits for that student.(seeoutput below)
10)the program file should be documented with a paragraph describing it and documentation throughout describing the lines of code.
11)use the following sample data as a guide. first run your program with the sample data. USE YOUR NAME, MAJOR, AND NUMBER OF CREDITS FOR THE FIRST STUDENT. then run the program again with your own set of sample data.
12)print your source code program file, header file, and typescript file(with your 2 sample runs)
student list

your name MAJ 6
jehanne D'Arc FRA 20
bill wohlleber CIS 9


Teachers.Net · https://teachers.net/lessons/2448.html

Save to My Desk

Sign in or create a free Teachers.Net account to keep this resource in your private library.