Function will remove the last element from the list.

Assignment Help Data Structure & Algorithms
Reference no: EM13944031

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.

Reference no: EM13944031

Questions Cloud

Calculate a regression line for data : 1. Plot the data.  Does there seem to be a linear relationship between the discount offered and sales on "Big Saturday" events? Yes or No  2. Calculate a regression line for this data (use whole numbers for the percent discount, that is, use 15 f..
What are some of challenges of becoming a critical thinker : What are some of the challenges of becoming a critical thinker in our contemporary world? In what ways do these challenges also make it important to develop critical thinking skills?
Include how unstable money can make an economy : Development of money in the economy and how it is used to create wealth. Include how unstable money can make an economy weaker.
State the rule of rejection : a) Is this an upper tail, lower tail, or two-tail test? b) Are we testing means or proportions? c) State the rule of rejection (in terms of p-value and level of significance)
Function will remove the last element from the list. : 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."
The quality of the discussion by making frequent : Discussion responses should be on topic, original, and contribute to the quality of the Discussion by making frequent, informed references to lesson materials and Seminars. Initial Discussion responses should be around 150 words. Responses to your cl..
Explain the economic significance of the lagrangian : Using the Lagrangian Multiplier method, calculate the least cost combinations of labor and capital and the resulting long run total cost function for the above production function. Explain the economic significance of the Lagrangian Multiplier and ca..
Find internal rate of return and payback period : Explain with a graph how SML is different from CML. Why CAPM equation might be more relevant than other equations when calculating required rate of return.
Accessing company information online : The group decided on the "Restaurant Industry", and selected "Swiss Chalet" as the specific restaurant so we can easily access company information online. You can review their website to draw on information for the description.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Find values of n insertion sort beat merge sort

For inputs of size n, insertion sort runs in 8n 2 steps, where as merge sort runs in 64* nlog base 2 n steps. For which values of n odes insertion sort beat merge sort?

  Relationships in a database model

Discuss different types of classifications and do they overlap, or do they each tell us something unique about the entity relationship?

  Write algorithm to calculate the volume of water

Write an algorithm to calculate the volume of water in cubic feet, flowing through pipe of diameter d in feet, with a velocity of v feet per second.

  Describe the data information decision

Describe the Data Information Decision

  Q1 consider the hire assistant problem we interview n

q1 consider the hire assistant problem. we interview n candidates and always hire the best qualified so far. let n 5

  What is the output of the first round of the des algorithm

What is the output of the first round of the DES algorithm when the plaintext and the key are both all zeros?

  Write a function that accepts an array of integers

Write a function that accepts an array of integers and the size of the array and prints out a table listing how many values in the array fall in each of the following ranges:

  How to store and reference data in an array list

How to store and reference data in an array list and How to delete data from the ArrayList

  Ancient world on later societies

Reflect on how the ancient world(Mesopotamia,Greece, and Rome) contributed significant ideas about government, law, religion, and the role of the individual to later societies.

  Create an asp.net project with visual studio

Design an ASP.NET assignment with Visual Studio that contains two aspx forms. The 1st form uses the Login control to a login page. Users should not be able to view second form unless they have entered a correct username and password.

  Data structures for a single algorithm

Data structures for a single algorithm

  Virtualization & memory

Evaluate the efficiency and reliability of both the most common nonpreemptive dispatch algorithms and the most common preemptive dispatch algorithms used for scheduling decisions. Provide one (1) example of the best use for each dispatch algorithm..

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