//tuitionCalculator.cpp: A university calculates tuition based on student classifications
#include<bits/stdc++.h>
using namespace std;
void calcResidentUndergradTuition(int numberOfCredits,double amountPerCredit,int *totalStudentArray,double *tuition)
{
int setAmountCredits=min(numberOfCredits,12);
int additionalCredits=max(0,numberOfCredits-12);
*tuition=(setAmountCredits*amountPerCredit)+(0.75*additionalCredits*amountPerCredit);
totalStudentArray[0]++;
}
void calcNonResidentUndergradTuition(int numberOfCredits,double amountPerCredit,int *totalStudentArray,double *tuition)
{
*tuition=5000.00+(0.80*numberOfCredits*amountPerCredit);
totalStudentArray[1]++;
}
void calcGraduateTuition(int *totalStudentArray,double *tuition)
{
*tuition=9500.00;
totalStudentArray[2]++;
}
void calcAlumniTuition(int numberOfCourses,int *totalStudentArray,double *tuition)
{
*tuition=(50*numberOfCourses);
totalStudentArray[3]++;
}
void printTotals(double totalTuitionCalculated,int *totalStudentArray)
{
cout<<"Total number of Resident Undergraduate students are: "<<totalStudentArray[0]<<"\n";
cout<<"Total number of Non-Resident Undergraduate students are: "<<totalStudentArray[1]<<"\n";
cout<<"Total number of Graduate students are: "<<totalStudentArray[2]<<"\n";
cout<<"Total number of Alumni as students are: "<<totalStudentArray[3]<<"\n";
cout<<"Total amount of tuition calculated are: "<<totalTuitionCalculated<<"\n";
}
void averageTuitionPerStudent(double totalTuitionCalculated,int *totalStudentArray)
{
int totalStudents=0;
for(int i=0;i<4;i++)
totalStudents+=totalStudentArray[i];
cout<<"Average tuition per student is: "<<(totalTuitionCalculated/totalStudents)<<"\n";
}
int main()
{
const double amountPerCredit=325.00;
double totalTuitionCalculated=0.00;
double tuition=0.00;
int numberOfCredits=0,numberOfCourses=0;
int studentCode=0;
int totalStudentArray[4]={0,0,0,0};
cout<<"Enter student code(-1 to end): ";
cin>>studentCode;
while(studentCode!=-1)
{
switch(studentCode)
{
case 0: // Resident undergraduate student processing
cout<<"Enter total number of credits in which student is enrolled\n";
cin>>numberOfCredits;
tuition=0.00;
calcResidentUndergradTuition(numberOfCredits,amountPerCredit,totalStudentArray,&tuition);
totalTuitionCalculated+=tuition;
break;
case 1: // Non-Resident undergraduate student processing
cout<<"Enter total number of credits in which student is enrolled\n";
cin>>numberOfCredits;
tuition=0.00;
calcNonResidentUndergradTuition(numberOfCredits,amountPerCredit,totalStudentArray,&tuition);
totalTuitionCalculated+=tuition;
break;
case 2: // Graduate Student processing
tuition=0.00;
calcGraduateTuition(totalStudentArray,&tuition);
totalTuitionCalculated+=tuition;
break;
case 3: // Alumni Student processing
cout<<"Enter number of courses in which a particular alumni is involved\n";
cin>>numberOfCourses;
tuition=0.00;
calcAlumniTuition(numberOfCourses,totalStudentArray,&tuition);
totalTuitionCalculated+=tuition;
break;
default:
cout << "ERROR: Invalid student code entered - Try again\n";
}
cout<<"Enter student code(-1 to end): ";
cin>>studentCode;
}
printTotals(totalTuitionCalculated,totalStudentArray);
averageTuitionPerStudent(totalTuitionCalculated,totalStudentArray);
return 0;
}
Description. A university calculates tuition based on student classifications. Resident undergraduate students (living in state) pay...
Create an abstract Student class for Parker University. The class contains fields for student ID number, last name, and annual tuition. Include a constructor that requires parameters for the ID number and name. Include get and set methods for each field; the setTuition() method is abstract. Create three Student subclasses named UndergraduateStudent, GraduateStudent, and StudentAtLarge, each with a unique setTuition() method. Tuition for an UndergraduateStudent is $4,000 per semester, tuition for a GraduateStudent is $6,000 per semester, and tuition for...
PART I: Create an abstract Java class named “Student” in a package named “STUDENTS”. This class has 4 attributes: (1) student ID: protected, an integer of 10 digits (2) student name: protected (3) student group code: protected, an integer (1 for undergraduates, 2 for graduate students) (4) student major: protected (e.g.: Business, Computer Sciences, Engineering) Class Student declaration provides a default constructor, get-methods and set-methods for the attributes, a public abstract method (displayStudentData()). PART II: Create a Java class named...
CS 1050 Homework Assignment 2 – SUMMER 2017 DUE Friday, July 7th at 5PM WARNING – Technology failing is not an excuse to turn in your assignment late. START EARLY so you will have time to fix problems before the deadline. Directions: Complete the following homework assignment using the description given in each section. Purpose: The Tuition.c program will be used to Read in the Student ID (an integer value) and use an array search see if the ID is...
Part I (20%) [File: Student.java] Create a class called Student that has the following stored properties: • StudentID • First Name • Last Name Class Student should have read/write properties, constructor(s) and should implement the Academic interface. For academic methods, return zero for average, zero for credits and false for graduate. Also implement the toString() method that returns the above information as a String. Part II (5%) [File: Academic.java] Create an interface Academic that declares three methods: 1. average -...
Write a C++ program that asks user number of students in a class and their names. Number of students are limited to 100 maximum. Then, it will ask for 3 test scores of each student. The program will calculate the average of test scores for each student and display with their names. Then, it will sort the averages in descending order and display the sorted list with students’ names and ranking. Follow the Steps Below Save the project as A4_StudentRanking_yourname....
C++ please use only easy code and stdio.h because im just a beginner Description Write the program that can manage the information of students as follows: S 1. This program has two phase; the input phase and the output phase. 2. In an input phase, a teacher inputs the information (name, score, and department) for each student. The total number of students who can be inputted should be defined as a NUM OF_STUDENT constant value. In this example, the value...
Create a C program to implement a grade book. Must follow these guidelines: 1. Use #define to define MAX_SIZE1 as 20, and MAX_SIZE2 as 10 2. Use typedef to define the following struct type: struct { char name[MAX_SIZE1]; int scores[MAX_SIZE2]; } 3. The program accepts from the comand line an integer n (<= 30) as the number of students in the class. You may assume that the input will always be valid. 4. Dynamically allocate memory for an array of...
Write a java code : Student ID at University is composed of year of admission and students number. we aim to implement a structure that improves operations of inserting and searching for a student. To enhance these operations, we will build a tree of linked lists (TreeOfLists) to combine advantages of both structures. Each node in this tree contains a linked list of all students who were admitted in that year. Each node in the linked list represents a student(id,...
PROGRAM DESCRIPTIONIn this project, you have to write a C++ program to keep track of grades of students using structures and files.You are provided a data file named student.dat. Open the file to view it. Keep a backup of this file all the time since you will be editing this file in the program and may lose the content.The file has multiple rows—each row represents a student. The data items are in order: last name, first name including any middle...
Problem Specification:Write a C++ program to calculate student’s GPA for the semester in your class. For each student,the program should accept a student’s name, ID number and the number of courses he/she istaking, then for each course the following data is needed the course number a string e.g. BU 101 course credits “an integer” grade received for the course “a character”.The program should display each student’s information and their courses information. It shouldalso display the GPA for the semester. The...