Question

using c++ i need a program like university enrollment, that tell me any information i need,...

using c++ i need a program like university enrollment, that tell me any information i need, for example if the teacher (administrator) wants to know how many students are on each class he select, in case if the student is trying to access so then the studen put his name on it and select the course and at the end shows how many credits en etc
0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include "pch.h"
#include <iostream>
#include<string>
#include <map>
#include<iterator>
using namespace std;
int main()
{

//Hard quoted data for students names

   string student_name[5] = { "anand","sunil","reesha","nazif","prabhat" };
   cout << "Are you a student or teacher ? Press s if you are student and press t if you are teacher.\n";

// variable declaration
   char user_type,class_type;
   string user_name;

// Take input from user for user type
cin >> user_type;
   if (user_type == 't'|| user_type=='T') {
       cout << "\nFor checking information of Class 1 , Enter 1";
       cout << "\nFor checking information of Class 2 , Enter 2";
       cout << "\nFor checking information of Class 3 , Enter 3";
       cout << "\nFor checking information of Class 4 , Enter 4";
       cout << "\nFor checking information of Class 5 , Enter 5\n";
       cin >> class_type;

//condition checking for class
       switch (class_type)
       {
       case '1':
           cout << "Number of students in Class 1 : 10";
           break;
       case '2':
           cout << "Number of students in Class 2 : 13";
           break;
       case '3':
           cout << "Number of students in Class 3 : 17";
           break;
       case '4':
           cout << "Number of students in Class 4 : 19";
           break;
       case '5':
           cout << "Number of students in Class 5 : 25";
           break;
       default:
           cout << "No record found for entered class";
           break;
       }
   }

//user is Teacher then this block of code would run
   else if (user_type == 's' || 'S') {
       cout << "\nPlease, Enter your name\n";

//take student name from user

cin >> user_name;
//getline(cin, user_name);
       int is_found = 0;

//iterate over student name array to find if user is in records
       for (int i = 0; i < 5; i++) {
           if (student_name[i] == user_name) {
               if (user_name == "anand") {
                   cout << "\nStudent Name : anand\nClass : Class 1\nCredits: 5";
               }
               if (user_name == "sunil") {
                   cout << "\nStudent Name : sunil\nClass : Class 2\nCredits: 7";
               }
               if (user_name == "prabhat") {
                   cout << "\nStudent Name : prabhat\nClass : Class 3\nCredits: 4";
               }
               if (user_name == "reesha") {
                   cout << "\nStudent Name : reesha\nClass : Class 4\nCredits: 9";
               }
               if (user_name == "nazif") {
                   cout << "\nStudent Name : nazif\nClass : Class 5\nCredits: 10";
               }
               is_found = 1;
               break;
           }
       }
       if (is_found == 0) {
           cout << "No record found for entered name !";
       }
   }
}

Add a comment
Know the answer?
Add Answer to:
using c++ i need a program like university enrollment, that tell me any information i need,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • i dont need no explanation just tell me the number to put in each box no...

    i dont need no explanation just tell me the number to put in each box no need to show work just give the number that gies in each box QUESTION 8 How many grams of lithium nitrate will be needed to make 200.0 grams of lithium sulfate, assuming that you have an adequate amount of lead (IV) sulfate to do the reaction? How much lead (IV) sulfate will you actually need? 363.229 Pb(SO4)2 + 4 LINO3 -> Pb(NO3)4 + 2...

  • i need positive comment and agree with the statement at leat 100 words 3. How can...

    i need positive comment and agree with the statement at leat 100 words 3. How can you avoid the pitfalls of teacher-coach role conflict? First let me explain what a pitfall of teacher-coach role conflict is. When the coach says that we will run five miles every two days, in your mind you would want to drop from that. Instead of doing that the coach would come up with different fun ways to run and have us, as a team...

  • This is a C++ Program, I need the program broken up into Student.h, Student.cpp, GradeBook.h, GradeBook.cpp,...

    This is a C++ Program, I need the program broken up into Student.h, Student.cpp, GradeBook.h, GradeBook.cpp, and Main.cpp 1. The system must be able to manage multiple students (max of 5) and their grades for assignments from three different assignment groups: homework (total of 5), quizzes (total (total of 2) of 4), and exams 2. For each student record, the user should be able to change the grade for any assignment These grades should be accessible to the gradebook for...

  • please I need to correct this paragraph That quality of education is the basis for building...

    please I need to correct this paragraph That quality of education is the basis for building an advanced and developed society and we can not achieve quality education and high efficiency without building future career plans for the graduates students, this will help to develop the society, because development needs good education and professional development race. Today's students are the main pillar in the development of the society. This is why students should be prepared and established according to the...

  • this assingent is to  pseudocode, i have instructions and the example my teacher had given me for...

    this assingent is to  pseudocode, i have instructions and the example my teacher had given me for this, could i have some assistance, i need to do this in netbeans IDE and i need to use the scanner method as well and i need to pass both. Overview: This assignment will allow you to use pseudocode to implement the program to see the value in planning first, coding later. While coding is the glamorous part of the job, software development is...

  • Case Study:UniversityLibrarySystem This case is a simplified (initial draft) of a new system for the University...

    Case Study:UniversityLibrarySystem This case is a simplified (initial draft) of a new system for the University Library. Of course, the library system must keep track of books. Information is maintained about both book titles and the individual book copies. Book titles maintain information about title, author, publisher, and catalog number. Individual copies maintain copy number, edition, publication year, ISBN, book status (whether it is on the shelf or loaned out), and date due back in. The library also keeps track...

  • I need help writing c++ code to make this program. 1. Define a function that can...

    I need help writing c++ code to make this program. 1. Define a function that can read the input file answers.dat. This function should not print anything. 2. Define a function that computes the quiz score of the function by comparing the correct answers to the student’s answer. The result should be a percentage between 0 and 100, not a value between 0 and 1. This function should not print anything. 3. Define a function that prints the report as...

  • i need this in C# please can any one help me out and write the full...

    i need this in C# please can any one help me out and write the full code start from using system till end i am confused and C# is getting me hard.I saw codes from old posts in Chegg but i need the ful complete code please thanks. Module 4 Programming Assignment – OO Design and implementation (50 points) Our Battleship game needs to store a set of ships. Create a new class called Ships. Ships should have the following...

  • I need help with Task 1 at the end. most of this is background information. Willowbrook...

    I need help with Task 1 at the end. most of this is background information. Willowbrook School is a small private school that has retained your services as a systems analyst to assist in the development of a new information system for the school’s administrative needs. Background Willowbrook School is a small, private school in the Midwest United States. For the past 20 years, it has offered a curriculum for preschool through 6th grade. Five years ago it expanded to...

  • In Java(using BlueJ) Purpose Purpose is to practice using file input and output, and array list...

    In Java(using BlueJ) Purpose Purpose is to practice using file input and output, and array list of objects. Also, this lab specification tells you only what to do, you now have more responsibility to design how to do it. Problem description You are given a text file called 'Students.txt' that contains information on many students. Your program reads the file, creating many Student objects, all of which will be stored into an array list of Student objects, in the Students...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT