Ask Computer Engineering Expert

Tracking a class list:

I want to implement a program that allows the user to manage a list of up to 20 students. The student information tracked by the program includes:

Student identification number, which is a 6 digit positive integer

Full name, a string of up to a maximum of 24 characters in length

Faculty which is indicated by a two character code (SC = Science; MG = Management; SS = Social Sciences)

Year of study which can only take on one of the following values: 1, 2, 3, or 4.

I want the program to allow the user to run basic list operations: initializing the list, displaying the list, adding an element to the end of the list, removing an element from the list, finding all students with a particular name, and sorting the list. These operations should be accessed through a menu driven interface:

Menu option Effect
(d)isplay Display the contents of the list
(a)add Add a new element to the end of the list
(r)emove Remove an existing element from the end of the list
(f)ind Find all students with a particular name
(s)ort Sorting the list in ascending order according to student ID number
(q)uit Quit the program

I want my program to: initialize the list to the starting values specified below, allow the user to display the list onscreen, and to quit the program.
Initializing the list. When the program is first runs the list will contain 6 elements I would like to be initialized to the values shown in the tables below. The ID number and name fields will be the same every time that the program is run but the faculty and year of study are randomly generated.

Constant fields: ID and name

Element no./ ID/ Full name
1 / 000001 / Smiley Smith-1
2 / 000002 / Smiley Smith-2
3 / 000003 / Smiley Smith-3
4 / 000004 / Smiley Smith-4
5 / 000005 / Smiley Smith-5
6 / 000006 / Smiley Smith-6

Randomly initialized field: The probability for a particular student being registered in a particular faculty are shown in the table below.

Faculty / Faculty code / Proportion of class
Science / SC / 50%
Management / MG / 25%
Social Sciences / SS / 25%

Randomly initialized field: The probability of a particular student being in the different years of study are shown in the table below.

Year of study Proportion of class
1 85%
2 10%
3 3%
4 2%

Displaying the list: The program I want should display all non-empty list elements from beginning to end. Although the exact format of the output can vary, I want it to be neat and legible please. I know one example format which could be:

Displaying class list
Student #1
Name: Smiley Smith-1
ID: 1

Faculty: SC
Year: 1

Student #2
Name: Smiley Smith-2
ID: 2

Faculty: MG
Year: 4
: :

If the list contains no elements then the program should indicate to the user that no elements will be displayed because the list is empty.

Extra features I need:

1)The extra features can be completed in whatever combination that you want.

Add an element to the end of the list (worth an increase of 1 letter step)
When the user selects this function from the menu the program will prompt the user to enter in the information for the new student and that student will be added to the end of the class list. The program must be able to handle a list of up to 20 students (inclusive). If the user tries to add additional students then your program should display an appropriate error message e.g., "Unable to add student because class is already full."

2)Remove an element from the end of the list (worth an increase of 1 letter step)

This function will remove the last element from the list. If the list currently empty then the program will display some sort of error message e.g., "Unable to remove student because class is currently empty."

3)Search for an element (worth an increase of 1 letter step)

When the user selects this function from the menu a prompt will appear asking him or her the name of the student to be found. The program will then step through the list and display all matches. For example suppose that the user wants to find all students in the class whose name is "Smiley Smith-1":

All instances of "Smiley Smith-1":
Name: Smiley Smith-1
ID: 000001

Faculty: SC
Year: 1

4)Sort the list into ascending order according to ID number (you can employ any sorting algorithm in order to sort the list).

Please do not use Java classes that automatically handle the list functions for you (e.g., class Vector and the Collections). However, please you can use Libraries that allow fo ext-based (console) input and output (I usually import tio.* so please use this in program)Also you can please use libraries that will randomly generate numbers (I usually use import java.util.* so please use this)

Also I want the program to compile and run in Unix please! In JAVA language please.

I compile my programs using the UNIX file name.java and I use the java compiler javac . This gives me name.class which can be run by typing java filename.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91614896
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Does bmw have a guided missile corporate culture and

Does BMW have a guided missile corporate culture, and incubator corporate culture, a family corporate culture, or an Eiffel tower corporate culture?

Rebecca borrows 10000 at 18 compounded annually she pays

Rebecca borrows $10,000 at 18% compounded annually. She pays off the loan over a 5-year period with annual payments, starting at year 1. Each successive payment is $700 greater than the previous payment. (a) How much was ...

Jeff decides to start saving some money from this upcoming

Jeff decides to start saving some money from this upcoming month onwards. He decides to save only $500 at first, but each month he will increase the amount invested by $100. He will do it for 60 months (including the fir ...

Suppose you make 30 annual investments in a fund that pays

Suppose you make 30 annual investments in a fund that pays 6% compounded annually. If your first deposit is $7,500 and each successive deposit is 6% greater than the preceding deposit, how much will be in the fund immedi ...

Question -under what circumstances is it ethical if ever to

Question :- Under what circumstances is it ethical, if ever, to use consumer information in marketing research? Explain why you consider it ethical or unethical.

What are the differences between four types of economics

What are the differences between four types of economics evaluations and their differences with other two (budget impact analysis (BIA) and cost of illness (COI) studies)?

What type of economic system does norway have explain some

What type of economic system does Norway have? Explain some of the benefits of this system to the country and some of the drawbacks,

Among the who imf and wto which of these governmental

Among the WHO, IMF, and WTO, which of these governmental institutions do you feel has most profoundly shaped healthcare outcomes in low-income countries and why? Please support your reasons with examples and research/doc ...

A real estate developer will build two different types of

A real estate developer will build two different types of apartments in a residential area: one- bedroom apartments and two-bedroom apartments. In addition, the developer will build either a swimming pool or a tennis cou ...

Question what some of the reasons that evolutionary models

Question : What some of the reasons that evolutionary models are considered by many to be the best approach to software development. The response must be typed, single spaced, must be in times new roman font (size 12) an ...

  • 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

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As