Questions
The program reads a text file with student records (first name, last name and grade on...

  • The program reads a text file with student records (first name, last name and grade on each line) and determines their type (excellent or ok). <--- Completed
  • Need help on this
  • Then it prompts the user to enter a command, executes the command and loops. The commands are the following:
    • "all" - prints all student records (first name, last name, grade, type).
    • "excellent" - prints students with grade > 89.
    • "ok" - prints students with grade <= 89.
    • "end" - exits the loop the terminates the program.

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...

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

  1. Sommer (1999) investigated student satisfaction with distance learning. One group of students took Introductory Psychology over the Internet and another group took the course in the usual classroom lecture format. Students rated their satisfaction with the course on a scale from 1 (not at all satisfied) to 9 (extremely satisfied). Sommer found that students in the distance learning condition had an average satisfaction of 4.33, with a standard deviation of 2.94, whereas students in the classroom format reported a mean satisfaction of 6.67 and a standard deviation of 0.82. State your null hypothesis, use α = 0.05 for a nondirectional test, and report your critical value. Is there a difference between the groups?
  1. Wilson (1999) studied impulse control in grade-school children. She studied 25 average third-graders and found a failure of impulse control 4.6 times per day, with a standard deviation of 2.1 times per day. Wilson also studied 36 third-graders diagnosed with ADHD and found that they showed failures of impulse control on average 7.2 times per day, with a standard deviation of 3.1. State your null hypothesis, use α = 0.01 for a directional test, and report your critical value. Do third-graders with ADHD have more trouble with impulse control?

In: Math

in c++ you need to write a program that maintains the gradebook for a specific course....

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...

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
  • car-list.txt
  • car-list-1.txt
  • car-list-2.txt
  • car-list-3.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
  • car-list.txt
  • car-list-1.txt
  • car-list-2.txt
  • car-list-3.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
  • car-list.txt
  • car-list-1.txt
  • car-list-2.txt
  • 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: The...

Write a program in Java and run it in BlueJ according to the following specifications:

  • The program reads a text file with student records (first name, last name and grade on each line) and determines their type (excellent or ok).
  • Then it prompts the user to enter a command, executes the command and loops. The commands are the following:
    • "all" - prints all student records (first name, last name, grade, type).
    • "excellent" - prints students with grade > 89.
    • "ok" - prints students with grade <= 89.
    • "end" - exits the loop the terminates the program.

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:

  • Use the Students.java, Excellent.java, and Ok.java classes from the course website and make the following modifications/additions:
    • Create an interface Student and implement it with classes Excellent and Ok to represent the excellent and ok students correspondingly.
    • Create an ArrayList and fill it with objects of classes Excellent and Ok to store all students from the file.
    • Use the ArrayList to print all, excellent and ok students. Use the instanceof operator to distinguish between excellent and ok objects.

/* 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...

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...

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

The Hidden Student Loan Debt Problem Much outrage has been expressed over the difficulty U.S. college...

The Hidden Student Loan Debt Problem

Much outrage has been expressed over the difficulty U.S. college students and recent graduates are facing because of their student loan debt. Since the recession began in 2008, the amount of student loan debt has spiked by 84 percent, with borrowers owing a record $1.2 trillion. Nearly 40 million Americans have at least one outstanding student loan, according to new research by Experian. But is the problem as dire as some make it out to be?

Today, the average student owes about $28,000 on student loans. That is a big number, but a recent article in Forbes used some comparisons to help put that number into perspective. For example, the average American car loan is $27,000 and purchasing a car does not deliver the high return on investment that a four-year college education does. The U.S. Census Bureau estimates that over an adult’s working life, someone with a bachelor’s degree can expect to earn nearly an extra million dollars on average compared with someone with only a high school diploma. Similarly, the average home mortgage loan in the U.S. is now over $280,000. Some observers have suggested that student loan debt may prevent young people from purchasing cars or homes and hence is a serious problem. That may be true to some extent, but I argue that the real problem today is wage stagnation, which adds years to when borrowers can pay off their student loans and does much more to limit their opportunities in life.

Please understand that I am not downplaying the hardships of student loan debt or the seriousness of the rising cost of education. A college education has become part of the American dream, right up there with home ownership and apple pie — and rightly so. Years ago, government programs were created to subsidize student loans to honor the belief in higher education and recent proposals aimed at forgiving or reducing student loan borrowing seem to echo the same sentiment.

Let’s review some recent legislation and proposals. A law signed by President George W. Bush to provide forgiveness of student loans for people going into public service for 10 years will begin helping people in 2017. Other officials are working to provide even more support to indebted students. Senator Elizabeth Warren (D-MA) developed the Bank on Students Emergency Loan Refinancing Act, which allows borrowers to refinance their student debt at today’s lower interest rates. Such refinancing is already commonplace with mortgages and cars, but has not been easily available in the student loan sector. The Obama administration estimates that the bill has the potential to help 25 million borrowers to save about $2,000 over the lifetime of their loans. Earlier this summer, the bill was blocked in the Senate, primarily because it would require the imposition of new taxes or the loss to the federal government of $60 billion in student loan interest payments over the next decade.

In truth, while the amount of student loan debt is concerning, it’s not the most serious problem facing college students and recent graduates. When adjusted for inflation, student loan debt has increased, but, as noted, it is about the size of a car loan on average. While horror stories have been reported about individuals who borrowed massive amounts to finance multiple degrees in fields offering few jobs, that problem is connected to factors beyond the availability of loans. A critical problem today is the stagnation of wages, which makes people take longer to pay back loans. Politicians overlook this and often focus on symptoms of the problem. This diverts attention from the stagnant economy and the reduction of public funding for higher education, which is being felt in many states, including Pennsylvania.

Subscribe to The Morning Email.

Wake up to the day's most important news.

Colleges do play a role in the problem, both for increasing costs so rapidly and for facilitating situations in which students can earn degrees that offer few opportunities in the job market. In an era of global markets, where jobs are often mobile and technology has automated many functions, colleges have not uniformly adjusted their standard model to ensure that students receive adequate preparation for work. While it is fine for university officials to say that they wish to educate students for their career and not their first job, it is imperative for colleges to provide career skills that allow students to find employment by using the critical thinking skills and other attributes provided in a traditional liberal arts education.

It is also essential for colleges to supplement the student experience in ways that enhance the employability of graduates. For example, a recent Gallup study showed that students who have strong relationships with faculty and mentors and have access to experiences that allow them to apply what is discussed in the classrooms (through internships, cooperative education programs, and other real-world and experience-based learning practices) are more successful in their careers and happier in life. Gallup identified six specific attributes and concluded that only three percent of the respondents strongly agreed that they had exposure to all six.

I am not saying that student loan indebtedness should be ignored. It is a problem, but it is less serious than other related problems. It is a symptom of a vicious cycle: State governments have reduced funding for higher education, which pushes tuition higher. Government-guaranteed student loans provide options for students to deal with higher college costs. Colleges use the increased tuition revenue to ensure budgets are met. There is inadequate pressure on colleges to emphasize job placement outcomes. Students and graduates have problems repaying the loans.

We are at a crossroads and must employ different solutions to address student loan debt. For their part, colleges must provide students with the necessary skills to be employable — even if it requires changing the traditional educational focus by adding career-focused majors in the liberal arts. Government must support higher education through consistent funding and by applying common sense to a variety of government-supported loan programs — for example, let people consolidate loans and set reasonable caps on the maximum amount that can be borrowed with a government guarantee. Society should recognize that some students will benefit more from a technical education program than a traditional college. Most importantly, government needs to stimulate wage growth, as this will lessen the problems of student loan debt much more effectively than will the creation of new legislation to forgive debt or the creation of new bureaucracies for monitoring colleges.

My q/s :- Student Loan. Is it worth it?

After reading above article post substantive comments on the student loan issue based on.(150-200)word

In: Economics

Explore the Web site for the Apple iPhone, the BlackBerry, and the Motorola Droid, then answer...

Explore the Web site for the Apple iPhone, the BlackBerry, and the Motorola Droid, then answer the following questions:

  1. List and describe the capabilities of each of these devices and give examples of how they could be used by businesses.
  2. List and describe three downloadable business applications for each device and describe their business benefits.

In: Accounting

In the early part of the 20th century, Niels Bohr proposed a model for the hydrogen...

In the early part of the 20th century, Niels Bohr proposed a model for the hydrogen atom that explained the experimentally observed emission spectrum for hydrogen.

a. List and describe two of the assumptions that Bohr made in his model for the hydrogen atom.

b. List and describe two limitations of the Bohr mode

In: Chemistry