The assignment: C++ program or Java
You need to use the following programming constructs/data structures on this assignment.
1. A structure named student which contains:
a. int ID; student id;
b. last name; // as either array of char or a string
c. double GPA;
2. An input file containing the information of at least 10 students.
3. An array of struct: read the student information from the input file into the array.
4. A stack: you can use the standard library template for the stack or you can write your own code for the different stack operations. The stack stores elements of type student.
5. Output file containing a duplicate of all output sent to the console.
What to do:
1. Read all students rows from the input file into an array.
2. Store the information about seven different students in the stack: This is intended to initialize the stack.
3. Generate a random number between 1 and 20.
4. If the randomly generated number is even, read one row from the array and store it (push it) into the stack.
5. If the randomly generated number is odd then check If the number is divisible by 3, if so ask the user if they want to quit.
6. If the user selects to continue or the odd number is not divisible by 3 then pop one element from the stack and send it to the output file.,
7. If the stack is not empty and you quit: it will display the number of the students left in the stack, and display the information of each student left in the stack.
8. If you choose to quit, and the stack is empty when a pop is needed, or the array is empty when a push is required then do the following:
a. Display on the console and send to the output file: “The reason for quitting”, how many elements are left on the stack when quitting, and the content of each student record found in the stack when quitting.
In: Computer Science
SUBJECT BTA (Foundations of B.A.)
Case Study
Spring Breaks R Us Travel Service
Chapter 3 – Use Cases
Spring Breaks ‘R’ Us (SBRU), introduced in Chapter 2, includes many use cases that make up the functional requirements. Consider the following description of the Booking subsystem. A few weeks before Thanksgiving break, it is time to open the system to new bookings. Students usually want to browse through the resorts and do some planning. When a student or group of students wants to book a trip, the system allows it. Sometimes, a student needs to be added or dropped from the group or a group changes size and needs a different type of room. One month before the actual trip, it is time for the system to send out final payment requirement notices. Students cancel the booking or they pay their final bills. Students often want to look up their booking status and check on resort details. When they arrive at the resort, they need to check in; and when they leave, they need to check out.
Case Question:
In: Computer Science
|
Placebo (0 mg) |
Drug (2 mg) |
Drug (4 mg) |
Drug (6 mg) |
|
4 |
7 |
16 |
17 |
|
7 |
8 |
14 |
18 |
|
11 |
13 |
12 |
13 |
|
11 |
6 |
11 |
17 |
|
7 |
9 |
15 |
20 |
|
10 |
9 |
13 |
15 |
In: Math
import java.util.Scanner;
import java.io.*;
import java.util.ArrayList;
public class Students
{
public static void main (String[] args) throws IOException
{ String first_name, last_name;
int grade, count=0;
Scanner fileInput = new Scanner(new File("students.txt"));
//Object st;
ArrayList<Student> st = new ArrayList<Student>();
while (fileInput.hasNext())
{
first_name = fileInput.next();
last_name = fileInput.next();
grade = fileInput.nextInt();
if (grade>89)
st.add(new Excellent(first_name, last_name, grade));
else
st.add(new Ok(first_name, last_name, grade));
count++;
}
for (int i=0; i<st.size(); i++)
{
if (st.get(i) instanceof Excellent)
st.get(i).info();
else
st.get(i).info();
}
System.out.println("There are " + count + " students");
}
}
public class Ok implements Student
{
private String fname, lname;
private int grade;
public Ok(String fname, String lname, int grade)
{
this.fname = fname;
this.lname = lname;
this.grade = grade;
}
public void info()
{
System.out.println(fname + " " + lname + " "+ grade + "\t" +
"ok");
}
}
public class Excellent implements Student
{
private String fname, lname;
private int grade;
public Excellent(String fname, String lname, int grade)
{
this.fname = fname;
this.lname = lname;
this.grade = grade;
}
public void info()
{
System.out.println(fname + " " + lname + " "+ grade + "\t" +
"excellent");
}
}
public interface Student
{
void info();
}
In: Computer Science
Directions: For each of the following studies, state both the null and alternative hypotheses and the decision rule, then work the problem. Look up the critical value of t that would cut off the tails of the distribution. Note that each study specifies the alpha value to use and whether to use a one- or two-tailed test. Decide whether to reject or fail to reject the null and answer the question. Please copy and paste the text into a document and include your answers in bold font.
There is no sample size for the first example. I will take whatever I can get to help solve
In: Math
in c++ you need to write a program that maintains the gradebook
for a specific course. For each student registered in this course,
the program keeps track of the student’s name, identification
number (id), four exam grades, and final grade. The program
performs several functionalities such as: enrolling a student in
the course, dropping a student from the course, uploading student’s
exam grades, displaying the grades of a specific student,
displaying the grades of all students in the course, and printing
grades summary information.
To do that, you need to create a structure, Student, that holds
individual student’s details. The Student struct contains the
following fields:
struct Student { string name; // student first and last name long
id; // student identification number double grades[4]; // array
holding four exam grades double finalGrade; // student final grade
}
Then, in your main program, you need to:
- declare a vector of Student structs, named students, to hold the
data for all the students enrolled in this course. - process a
transaction file, “StudentsTrans.txt”. Each line in the file
contains a specific command such as “enroll”, “display”, “drop”,
“uploadGrades”, “searchByName”, and “printClassSummary”. The line
also contains all necessary data to process the command. Each
command must be implemented in a separate function. The commands
are:
▪ Enroll StudentFirstName StudentLastName StudentID
This command adds a new Student record (object) to the students’
vector. You should read the student details from the transaction
file (StudentFirstName, StudentLastName, StudentID). Before
creating a new object, you need to check for duplicate student
entries (if an existing student has the same StudentID). If this
student was not previously added to the students vector, you should
add an entry for that student and its details at the end of the
students’ vector. Make sure to concatenate StudentFirstName and
StudentLastName into one student name and set all grades initially
to zeros. You can simply use the push_back function to add a
Student object to the end of the vector. You should also display a
message that the student was successfully added to the vector. For
example:
enroll Joe Garcia 432345673 Joe Garcia successfully added to
students vector…
If this student already exists in the vector, you should not add
the student again to the vector. You should also display an error
message. For example:
enroll Amelia Perez 876007654 Student already enrolled in this
class, can not enroll again
▪ Display
This command displays the details of all students registered in the
course in a neat table format. Details include a student’s name,
id, four individual exam grades, and the final grade. The
final
grade is the average of the four exam scores. You should print
decimal numbers with 2 digits of precision. A sample display is
shown below:
Student ID Exam1 Exam2 Exam3 Exam4 Final
Grade
-------------------------------------------------------------------------
Suzy Walter 876523067 87.50 85.00 88.00 81.00 85.38
Amelia Perez 876007654 62.00 70.00 71.50
80.00 70.88 …
▪ SearchByName Keyword
This command searches and prints the records of all students whose
first names, last names, or full names include or match Keyword.
For example, if Keyword is “James”, you should display the
following students:
searchByName James Student ID Exam1 Exam2 Exam3 Exam4 FinalGrade
------------------------------------------------------------------------
James Ducrest 123282345 62.00 67.00 63.00 70.00 66.25 James Didier
123456789 79.00 85.00 80.00 88.00 83.00
If no matching entry is found, you should display a message that
this student is not enrolled in this course. For example:
searchByName Michel No such student exists
▪ Drop StudentID
This command drops a specific student (whose id is StudentID) from
the course by removing its entry from the students’ vector. You
should check if that student is enrolled in this class before
trying to delete its entry. If so, pay attention that deleting
could be from any entry in the vector and not necessarily the last
record. You should also display a message that the student was
successfully deleted from the vector. For example:
drop 982323146… Andrea Meyer successfully dropped from course
If no matching entry is found, you should display a message that
this student does not exist. For example:
drop 012345634… No such student exists
▪ UploadGrades StudentID Grade1 Grade2 Grade3 Grade4
This command uploads the grades of a specific student to the
corresponding entry in the students vector. The command specifies
StudentID, which corresponds to the id of the student whose grades
should be uploaded. The command also specifies the 4 individual
exam grades for that student (Grade1 Grade2 Grade3 Grade4). You
should search for the student whose id matches StudentID. If a
match is found, you should update its grades array and display a
message that the student’s grades were successfully uploaded. For
example:
uploadGrades 876523067 87.5 85 88 81 Suzy walter grades
successfully uploaded
Otherwise, you should display a message that this student was not
found. For example:
uploadGrades 999999999 60 90 70 80 no such student exists, grades
can not be uploaded
▪ PrintClassSummary
This command prints summary information. This includes: the name of
the student who took the highest final grade in this course, the
name of the student who took the lowest final grade in this course,
and the overall class average.
To test your code, you may create and process the following
transaction file:
“StudentsTrans.txt”
enroll Joe Garcia 432345673
enroll Suzy Walter 876523067
enroll Amelia Perez 876007654
enroll James Ducrest 123282345
enroll Amelia Perez 876007654
enroll Suzy Walter 987667654
enroll James Didier 123456789
enroll Carolyn Johnson 456283409
enroll Andrea Meyer 982323146
enroll Edward Weber 787878123
display
drop 012345634
drop 982323146
drop 432345673
uploadGrades 432345673 98 98 99 93
uploadGrades 999999999 60 90 70 80
uploadGrades 876523067 87.5 85 88 81
uploadGrades 876007654 62 70 71.5 80
uploadGrades 123282345 62 70 63 70
uploadGrades 987667654 81 83 75 90
uploadGrades 123456789 79 85 80 88
uploadGrades 456283409 95 91 92 94
uploadGrades 787878123 99 98.5 95 94
searchByName James
searchByName John
searchByName Edward
searchByName Michel
searchByName Amelia Perez
display printClassSummary
In: Computer Science
In java, ask the user for a filename. Display the oldest car for every manufacturer from that file.
Files Given:
car-list.txt
car-list-1.txt
car-list-2.txt
car-list-3.txt
(they are too big for question)
Required Output:
| Standard Input | Files in the same directory |
|---|---|
car-list-1.txt |
|
Enter filename\n
Oldest cars by make\n
Acura Legend 1989 2T1BPRHE8EC858192\n
Audi 80/90 1988 2GKALMEK4E6424961\n
Bentley Continental Flying Spur 2006 WBA3G7C5XFK430850\n
BMW 600 1959 1N6AA0ED2FN639969\n
Bugatti Veyron 2009 SCFEBBBC5AG474636\n
Buick Century 1987 2HNYD18625H455550\n
Cadillac DeVille 1994 19UUA56793A243886\n
Chevrolet Camaro 1968 WAUDF98E18A693314\n
Chrysler Town & Country 1996 1GYS4EEJ3DR377025\n
Dodge Charger 1970 WBAEW53475P758543\n
Eagle Vision 1995 SCFHDDAJ3AA914259\n
Ferrari 599 GTB Fiorano 2010 2G61M5S34E9207892\n
Ford Fairlane 1966 2G4WF551041378204\n
GMC Sonoma Club 1992 WAUBFAFL9DN784019\n
Honda CR-X 1984 1FT7W2A66EE489233\n
Hummer H2 2008 5N1AR2MM0FC360861\n
Hyundai Entourage 2008 1GYS3SKJ7FR311229\n
Infiniti Q 1992 SCFEBBAK0CG532695\n
Isuzu Space 1994 2T1BURHEXEC222169\n
Jaguar X-Type 2006 2G4GU5GV2C9513452\n
Jeep Cherokee 1995 5XYKT3A67FG750891\n
Kia Spectra 2006 2C3CDYAG7EH527567\n
Lamborghini Countach 1988 JTMHY7AJ1B5630207\n
Land Rover Range Rover 1988 5UXFE8C59AL755549\n
Lexus LS 1993 WAUNF78P97A339372\n
Lincoln Continental 1988 WAUXL68E74A407027\n
Lotus Elise 2007 5NPEB4AC8CH254031\n
Maserati Biturbo 1987 1G4HF57909U685797\n
Maybach 57 2004 1ZVBP8AM3B5509118\n
Mazda 626 1984 WUARL48H69K855595\n
Mercedes-Benz S-Class 1986 JN1BJ0HP2EM742216\n
Mercury Cougar 1970 WBANE73577C052898\n
Mitsubishi Starion 1985 WAUSF98E66A919061\n
Morgan Aero 8 2007 WBA3C3G57FN486516\n
Nissan Quest 2001 1D4PT4GX3BW366571\n
Oldsmobile Custom Cruiser 1992 WDDHF5KB6FB836573\n
Panoz Esperante 2006 1G6KD57Y67U241895\n
Plymouth Voyager 1992 WBAWB73589P509971\n
Pontiac Tempest 1965 WBAKA4C59BC513301\n
Porsche 911 1986 JTHBE1KS8A0650998\n
Rolls-Royce Phantom 2005 WAUCFAFH6EN529880\n
Saab 9000 1989 WBAVA37528N742448\n
Saturn VUE 2006 1FBAX2CM5FK123544\n
Scion xB 2006 4T3BA3BB7CU135336\n
Shelby GT350 1969 KL4CJESB0FB714062\n
Studebaker Avanti 1962 1GD312CG5DF955034\n
Subaru Justy 1990 KM8JT3AB2CU942198\n
Suzuki SJ 1986 WAU4FAFR9AA736195\n
Toyota Celica 1982 3VWF17AT4FM332454\n
Volkswagen Golf 1987 WDCYC7DF8FX386498\n
Volvo 850 1995 1GD312CG7BF949846\n
51 result(s)\n
Test Case 2
| Standard Input | Files in the same directory |
|---|---|
car-list-2.txt |
|
Enter filename\n
Oldest cars by make\n
Acura Integra 1995 WBA3B5G54EN915107\n
Alfa Romeo 164 1994 5GAER23758J589585\n
Audi 4000s 1985 JN8AF5MR9DT832857\n
Bentley Continental Flying Spur 2007 JN1BY0AP0AM634709\n
BMW 600 1959 KNADM5A36E6321537\n
Bugatti Veyron 2009 SCFEBBBC5AG474636\n
Buick Somerset 1985 5N1AA0NC1DN101234\n
Cadillac DeVille 1994 19UUA56793A243886\n
Chevrolet Corvette 1953 3GYFNGEY7BS365963\n
Chrysler Cirrus 1999 1GYFC33249R710666\n
Daewoo Lanos 2002 KNDMG4C79E6368226\n
Dodge Omni 1978 SALGR2VF2FA732350\n
Eagle Summit 1996 KNAGM4AD9D5309595\n
Ferrari 430 Scuderia 2008 1HGCP2E70CA912895\n
Ford Fairlane 1966 2G4WF551041378204\n
Geo Prizm 1994 SALGS2DF9DA398353\n
GMC Rally Wagon 3500 1993 1N6AF0KX1EN730343\n
Honda Prelude 1985 19UUA76667A337717\n
Hyundai Santa Fe 2001 JTDKN3DP0C3011229\n
Infiniti Q 1992 1G4HP52K444142193\n
Isuzu Trooper 1997 4F2CY0C75BK199939\n
Jaguar X-Type 2006 2G4GU5GV2C9513452\n
Jeep Grand Cherokee 2003 1GYFK43549R321965\n
Kia Sephia 1995 4F2CY0C77AK663764\n
Lamborghini Countach 1989 1FTSW2A51AE796515\n
Land Rover Range Rover 1988 5UXFE8C59AL755549\n
Lexus LS 1991 1G4HF57959U054981\n
Lincoln Town Car 1989 1D7RV1CT3BS523594\n
Lotus Elan 1990 WBANA53575C102986\n
Maserati Quattroporte 1984 1G6DS5E31C0696841\n
Maybach 57 2003 JTJBJRBZ7F2575213\n
Mazda 626 1985 19UUA56663A426458\n
Mercedes-Benz W201 1991 SCFFBCCD3BG450032\n
Mercury Cougar 1970 WBANE73577C052898\n
MINI Cooper 2002 WBAYP1C51FD265309\n
Mitsubishi Starion 1985 WAUSF98E66A919061\n
Nissan NX 1992 WAUDV74F98N860145\n
Oldsmobile Toronado 1992 JH4DC54893S582029\n
Panoz Esperante 2005 WA1CMAFE4ED877109\n
Peugeot 207 2007 3C63DPBL8CG511366\n
Plymouth Voyager 1992 WBAWB73589P509971\n
Pontiac Tempest 1965 WBAKA4C59BC513301\n
Porsche 911 1986 JTHBE1KS8A0650998\n
Rolls-Royce Phantom 2005 WAUCFAFH6EN529880\n
Saab 9000 1989 WBAVA37528N742448\n
Saturn S-Series 2002 2T1KU4EE6DC200286\n
Scion xD 2011 YV1672MC1AJ515133\n
Shelby GT350 1969 KL4CJESB0FB714062\n
Subaru Brat 1986 3D7TT2CT3BG995173\n
Suzuki SJ 1988 1D4PU5GK6BW944265\n
Toyota Celica 1982 3VWF17AT4FM332454\n
Volkswagen Passat 1987 1G6DV1EP8C0229130\n
Volvo C70 1998 2C3CDZBT6FH112033\n
53 result(s)\n
Test Case 3
| Standard Input | Files in the same directory |
|---|---|
car-list-3.txt |
|
Enter filename\n
Oldest cars by make\n
Acura Legend 1989 2T1BPRHE8EC858192\n
Aston Martin DB9 Volante 2006 KNDKG3A24A7680578\n
Audi 80/90 1988 2GKALMEK4E6424961\n
Bentley Continental Flying Spur 2006 2C3CCABG2CH411828\n
BMW 600 1959 1N6AA0ED2FN639969\n
Buick Skylark 1986 1G6AB5R31F0410780\n
Cadillac DeVille 1994 19UUA56793A243886\n
Chevrolet Corvair 1960 1GTN1TEH5FZ654712\n
Chrysler Imperial 1926 3N1CE2CP2FL275760\n
Citroën CX 1989 1N6AA0CJ6EN188987\n
Dodge Charger 1970 WBAEW53475P758543\n
Eagle Vision 1995 SCFHDDAJ3AA914259\n
Ferrari 599 GTB Fiorano 2010 2G61M5S34E9207892\n
Ford Mustang 1971 WAUWFAFR6DA642708\n
Geo Prizm 1993 SCFEDCAD4CG747594\n
GMC Sonoma Club 1992 WAUBFAFL9DN784019\n
Honda CR-X 1984 1FT7W2A66EE489233\n
Hummer H2 2008 5N1AR2MM0FC360861\n
Hyundai XG350 2002 WAUFMAFC2EN588576\n
Infiniti Q 1992 SCFEBBAK0CG532695\n
Isuzu Space 1994 2T1BURHEXEC222169\n
Jaguar S-Type 2001 WBASN2C55DC838510\n
Jeep Cherokee 1995 5XYKT3A67FG750891\n
Kia Spectra 2006 2C3CDYAG7EH527567\n
Lamborghini Countach 1988 JTMHY7AJ1B5630207\n
Land Rover Range Rover 1988 5UXFE8C59AL755549\n
Lexus LS 1993 WAUNF78P97A339372\n
Lincoln Continental 1988 WAUXL68E74A407027\n
Lotus Exige 2004 1D7RV1CT6AS741379\n
Maybach 57 2004 1ZVBP8AM3B5509118\n
Mazda 626 1984 WUARL48H69K855595\n
Mercedes-Benz S-Class 1986 JN1BJ0HP2EM742216\n
Mercury Cougar 1970 WBANE73577C052898\n
Mitsubishi Galant 1986 5N1AT2ML1EC611331\n
Morgan Aero 8 2007 WBA3C3G57FN486516\n
Nissan NX 1992 WAUDV74F98N860145\n
Oldsmobile Toronado 1992 JH4DC54893S582029\n
Panoz Esperante 2008 3D73Y4EL2AG593685\n
Plymouth Volare 1976 1G6EL12Y32B567559\n
Pontiac Tempest 1965 WBAKA4C59BC513301\n
Porsche 911 1986 WBSBR93426P234215\n
Rolls-Royce Ghost 2012 1D7RE2GK4BS527662\n
Saab 900 1996 ZFBCFACH5FZ823825\n
Saturn VUE 2006 1FBAX2CM5FK123544\n
Scion xB 2006 4T3BA3BB7CU135336\n
Shelby GT350 1969 KL4CJESB0FB714062\n
Studebaker Avanti 1962 1GD312CG5DF955034\n
Subaru Justy 1990 KM8JT3AB2CU942198\n
Suzuki SJ 1986 WAU4FAFR9AA736195\n
Toyota MR2 1986 JTDKTUD35ED964783\n
Volkswagen Golf 1987 WDCYC7DF8FX386498\n
Volvo 850 1995 1GD312CG7BF949846\n
52 result(s)\n
A few lines of cars-list that might help:
make model year vin Lexus LX 2010 4T3BA3BB8CU505032 Dodge Ram Van B350 1994 5N1CR2MNXEC243935 Volkswagen Type 2 1986 WAUDF48H17K529096 Buick Lucerne 2011 1FTNX2A57AE582302 Isuzu Axiom 2004 WBA3A5C53EP267014 GMC 3500 Club Coupe 1995 WBAEK73435B009775 Jaguar XF 2012 WBAFR7C50CC926771 Toyota Tacoma 2010 JTEBU5JR2C5510537 BMW X6 M 2013 1D7RB1CT9BS271133 Pontiac GTO 1964 WAUJFAFH5DN416041 Volkswagen CC 2013 1C3CCBAG9EN215371 Ford LTD Crown Victoria 1993 WBXPA93424W053318 Ford Aerostar 1994 1FMEU6FE6AU161181 Volvo S60 2001 WAUSF78E27A949809 Mitsubishi Eclipse 1991 1FTEW1C80AK681226 Volkswagen Touareg 2004 1B3CB5HA6AD986681 Volvo S80 2002 WBAYA8C58FG901796 Acura RL 2008 19UUA66268A236346 Porsche 928 1986 2T1BURHE2FC730993 Buick Somerset 1987 WAUCKAFR5AA102258 Volkswagen Touareg 2010 WAUKF98P49A574439 Chevrolet Express 2006 JH4KB163X7C282844 Dodge Charger 2011 WBAHL83566D244296 Toyota Matrix 2012 2C3CCAEG0FH601353 Chevrolet 2500 2000 WAUBF48H37K132190 Jaguar XK Series 2005 19UUA9F25BA671349 Hummer H3 2006 1FMEU6EE2AU658326 Lincoln MKT 2010 1GT022CG3EF969732 Mitsubishi Galant 1997 WBAUC73528V077781 Lotus Exige 2006 2T2BK1BA6EC560905 Suzuki Sidekick 1993 3C3CFFAR1DT265678 Mercury Cougar 1993 3C63D3JL5CG653202 Dodge Ram Wagon B350 1994 3VWKP7AJ8DM315908 Chevrolet G-Series G20 1992 1D4RE5GG2BC413258 BMW M3 2009 5N1AN0NUXFN200196 BMW X5 2004 WAUUL78E75A789974 Ford E-Series 1996 WP1AE2A27CL645373 Mazda Mazda6 2007 WBAYP9C58ED417275 Mazda Tribute 2005 19UUA9F76CA390478 Lotus Elise 2007 1G6DJ5EG7A0576643 Dodge Dakota 2002 WBA3A9C5XFK249518 Volkswagen Quantum 1984 WBANV13548C686202 Lexus RX 2001 KM8JT3AB2DU052530 Pontiac Turbo Firefly 1990 5NPDH4AE1CH808652 Land Rover Freelander 2010 4T1BD1EB7EU689348 Acura NSX 2002 1FTNF2B54AE400508 Mercedes-Benz SL-Class 2002 WBA3B9G54FN126853 Cadillac Escalade 2004 2T1BU4EEXCC690200 Toyota Camry Solara 2008 3GYFNFE36FS186821
Notes in program and right format if possible, thanks. You can use any of the sorting searches like bubble or selection search or QuickSort since this is the section we are working on.
P.S This was the question I was given, I can't edit it to give more detail and I can't edit the outputs needed to have anything else because those are non editable and so are the given files.
In: Computer Science
Write a program in Java and run it in BlueJ according to the following specifications:
For example, if the input text file is students.txt and the user enters "all" the program prints the following:
John Smith 90 excellent
Barack Obama 95 excellent
Al Clark 80 ok
Sue Taylor 55 ok
Ann Miller 75 ok
George Bush 58 ok
John Miller 65 ok
If the user enters "excellent" the program prints the following:
John Smith 90 excellent
Barack Obama 95 excellent
If the user enters "ok" the program prints the following:
Al Clark 80 ok
Sue Taylor 55 ok
Ann Miller 75 ok
George Bush 58 ok
John Miller 65 ok
Requirements and restrictions:
/* ArrayList, Interfaces, Class Object and instanceof
operator
*
Suggested exercises:
- Create an ArrayList and fill it with Excellent and Ok
objects.
Use the instanceof operator and casting to print the array (calling
the info() method).
- Create interface Student (with info() method) and modify classes
Excellent and Ok to implement Student.
Define the ArrayList of type Student. Print the array. Is casting
needed?
*/
import java.util.Scanner;
import java.io.*;
public class Students
{
public static void main (String[] args) throws IOException
{ String first_name, last_name;
int grade, count=0;
Scanner fileInput = new Scanner(new File("students.txt"));
Object st;
while (fileInput.hasNext())
{
first_name = fileInput.next();
last_name = fileInput.next();
grade = fileInput.nextInt();
if (grade>89)
st = new Excellent(first_name, last_name, grade);
else
st = new Ok(first_name, last_name, grade);
if (st instanceof Excellent)
((Excellent)st).info();
else
((Ok)st).info();
count++;
}
System.out.println("There are " + count + " students");
}
}
public class Excellent
{
private String fname, lname;
private int grade;
public Excellent(String fname, String lname, int grade)
{
this.fname = fname;
this.lname = lname;
this.grade = grade;
}
public void info()
{
System.out.println(fname + " " + lname + "\t" + "excellent");
}
}
public class Ok
{
private String fname, lname;
private int grade;
public Ok(String fname, String lname, int grade)
{
this.fname = fname;
this.lname = lname;
this.grade = grade;
}
public void info()
{
System.out.println(fname + " " + lname + "\t" + "ok");
}
}
public interface Student
{
void info();
}
students.txt
John Smith 90 Barack Obama 95 Al Clark 80 Sue Taylor 55 Ann Miller 75 George Bush 58 John Miller 65
In: Computer Science
Many business students are familiar with the pressure to get internships or part-time jobs in their career field while in school. The surest route to the career track for many is to take on these limited-duration work assignments. Internships do give employers an easy way to size up potential applicants in a setting identical to the one in which they would perform. And unlike employees, interns are easily terminated if they don’t pan out. It’s the same situation for part-time or summer workers, who are sometimes let go at a moment’s notice. Internships are such a powerful tool for finding jobs that some students have begun to take on low-paid or even unpaid work assignments. While such “early bird” internships used to be primarily associated with large organizations, many startups have begun to attract students. For example, Remy Agamy took an internship at a three-person design company, knowing that it wasn’t likely to turn into a job. Still, in the job market she found that other prospective employers were keen on learning what she’d done in this internship. “I think we talked more about my eight-week internship than my four years of consulting experience,” she said. The value of internships for students, however, has long been questioned. While there may be a promise of a chance to learn, many students complain of doing little more than acting as unpaid, unskilled labor. Christina Isnardi is one student who felt exploited by the system. She described working 16- or 17-hour days at Lions Gate Entertainment, doing work like taking breakfast orders or working in locations far from the actual film set. “We just feel as though our dreams are holding us hostage to this unfair, unethical labor practice.” Isnardi’s experiences are not uncommon. Interns working for organizations as diverse as MTV, Warner Music Group, and Madison Square Garden describe similar experiences, which is why all these organizations have all faced lawsuits from former interns. In what might seem like a dream job, other students have negotiated great-sounding internships at organizations that regularly hire interns and pay them, but then don’t know what to do with these temporary employees. One student we know of was encouraged to make the best use of his time during his summer internship in a major city, including taking a paying job elsewhere and just staying in touch by phone when work hours overlapped! Because of his ingenuity, he reported it was a very productive summer, but the internship didn’t provide the learning opportunity he was seeking. Many major organizations maintain internship programs as part of a broader corporate social responsibility (CSR) value. Whether internships have value remains an open question. Most of the controversy does suggest that students need to know the details before agreeing to these arrangements, because not all internships offer a fair living wage or a strong career experience. HR departments are responsible for monitoring and designing internship programs. Question 1: Discuss the main concerns in the case. Why are these problems related to OB and HR? explain.
Question 2: As an upcoming employee student, what specific characteristics would you look for in an internship? Is there any form of good practice in intership at Lions Gate Entertainment? Discuss.
Question 3: In line with your answers in question 1, what are the recommendations you can offer? Be s[pecific with your answers.
In: Psychology
Many business students are familiar with the pressure to get internships or part-time jobs in their career field while in school. The surest route to the career track for many is to take on these limited-duration work assignments. Internships do give employers an easy way to size up potential applicants in a setting identical to the one in which they would perform. And unlike employees, interns are easily terminated if they don’t pan out. It’s the same situation for part-time or summer workers, who are sometimes let go at a moment’s notice.
Internships are such a powerful tool for finding jobs that some students have begun to take on low-paid or even unpaid work assignments. While such “early bird” internships used to be primarily associated with large organizations, many startups have begun to attract students. For example, Remy Agamy took an internship at a three-person design company, knowing that it wasn’t likely to turn into a job. Still, in the job market she found that other prospective employers were keen on learning what she’d done in this internship. “I think we talked more about my eight-week internship than my four years of consulting experience,” she said.
The value of internships for students, however, has long been questioned. While there may be a promise of a chance to learn, many students complain of doing little more than acting as unpaid, unskilled labor. Christina Isnardi is one student who felt exploited by the system. She described working 16- or 17-hour days at Lions Gate Entertainment, doing work like taking breakfast orders or working in locations far from the actual film set. “We just feel as though our dreams are holding us hostage to this unfair, unethical labor practice.” Isnardi’s experiences are not uncommon. Interns working for organizations as diverse as MTV, Warner Music Group, and Madison Square Garden describe similar experiences, which is why all these organizations have all faced lawsuits from former interns.
In what might seem like a dream job, other students have negotiated great-sounding internships at organizations that regularly hire interns and pay them, but then don’t know what to do with these temporary employees. One student we know of was encouraged to make the best use of his time during his summer internship in a major city, including taking a paying job elsewhere and just staying in touch by phone when work hours overlapped! Because of his ingenuity, he reported it was a very productive summer, but the internship didn’t provide the learning opportunity he was seeking. Many major organizations maintain internship programs as part of a broader corporate social responsibility (CSR) value.
Whether internships have value remains an open question. Most of the controversy does suggest that students need to know the details before agreeing to these arrangements, because not all internships offer a fair living wage or a strong career experience. HR departments are responsible for monitoring and designing internship programs.
Question 1: What are the potential challenges for Human Resource Department in the changing face of internship as it was originally arranged?
Question: What are the benefits of internship to the potential employee?
Question 3: How can the Human Resource Department mopnitor and design internship programs?
In: Psychology