101 students won iPhone. The winners listed in sorted order. How many iterations will it take for a binary search to find a particular name on the list, in the worst case?
In: Computer Science
In: Statistics and Probability
Increased government spending will reduce long-run growth rate of real GDP if :
a. the government spending involves building dams and levees.
b. the private spending that is crowded out is investment spending.
c. the private spending that is crowded out is consumption spending.
d. the government spending involves increased spending on highways and bridges.
In: Economics
In: Economics
Create a program in Java for storing the personal information of students and teachers of a school in a .csv (comma-separated values) file.
The program gets the personal information of individuals from the console and must store it in different rows of the output .csv file.
Input Format
User enters personal information of n students and teachers using the console in the following
format:
n
Position1 Name1 StudentID1 TeacherID1 Phone1
Position2 Name2 StudentID2 TeacherID2 Phone2
Position3 Name3 StudentID3 TeacherID3 Phone3
. . .
Positionn Namen StudentIDn TeacherIDn Phonen
Please note that the first line contains only an integer counting the number of lines
following the first line.
In each of the n given input lines,
Position must be one of the following three strings “student”, “teacher”, or “TA”.
Name must be a string of two words separated by a single comma only.
StudentID and TeacherID must be either “0” or a string of 5 digits. If Position is “teacher”, StudentID is zero, but TeacherID is not zero. If Position is “student”, TeacherID is zero, but StudentID is not zero. If Position is “TA”, neither StudentID nor TeacherID are zero.
Phone is a string of 10 digits.
If the user enters information in a way that is not consistent with the mentioned format,
your program must use exception handling techniques to gracefully handle the situation
by printing a message on the screen asking the user to partially/completely re-enter the
information that was previously entered in a wrong format.
Data Structure, Interface and Classes
Your program must have an interface called “CSVPrintable” containing the following three methods:
String getName ();
int getID ();
void csvPrintln ( PrintWriter out);
You need to have two classes called “Student” and “Teacher” implementing CSVPrintable
interface and another class called “TA” extending Student class. Both Student and Teacher classes must have appropriate variables to store Name and ID.
In order to store Phone, Student class must have a phone variable of type long that can store a 10-digit integer; while the Teacher class must have a phone variable of type int to store only the 4-digit postfix of the phone number.
Method getName has to be implemented by both Student and Teacher classes in the same way. Class Student must implement getID in a way that it returns the StudentID and ignores the TeacherID given by the input. Class Teacher must implement getID in a way that it returns the TeacherID and ignores the StudentID given by the input. Class TA must override the Student implementation of getID so that it returns the maximum value of StudentID and TeacherID.
Method csvPrintln has to be implemented by Student and Teacher classes (and overridden by TA class) so that it writes the following string followed by a new line on the output stream out:
getName() + “,” + getID() + “,” + phone
Output .csv File
The program must store the personal information of students,
teachers and TAs in a commaseparated values (.csv) file called
“out.csv”. You need to construct the output file by repetitively
calling the csvPrintln method of every CSVPrintable object
instantiated in your program. The output .csv file stores the
information of every individual in a separate row; while each
column of the file stores different type of information regarding
the students and teachers (i.e. Name, ID and phone columns). Please
note that you should be able to open the output file of your
program using MS-Excel and view it as a table.
Sample Input/Output
Assume that the user enters the following four lines in console:
Teacher Alex,Martinez 0 98765 3053489999
Student Rose,Gonzales 56789 0 9876543210
TA John,Cruz 88888 99999 1234567890
The program must write the following content in the out.csv file.
Alex Martinez,98765,9999
Rose Gonzales,56789,9876543210
John Cruz,99999,1234567890
In: Computer Science
Individually identify what you consider to be the greatest achievements accomplished by mankind in the last five decades. Now share your list with three to five other students in the class, and come up with an expanded list. Review these accomplishments in terms of the definition of a project. What does your review suggest about the importance of project management?
In: Operations Management
A point charge with a mass of 1.81 ng and a charge of +1.22 uC moves in the x-y plane with a velocity of 3.00 x 104 m/s in a direction 15° above the +x-axis. At time t=0, the point charge enters a uniform magnetic field of strength 1.25 T that points in the +x-direction. Assume that the point charge remains immersed in the uniform magnetic field after time t=0.
a. (5 points) What is the magnitude and direction of the magnetic force that the magnetic field exerts on the point charge at time t=0?
b. (5 points) How does the x-component of the charge’s initial velocity effect the motion of this point charge as it moves through the uniform magnetic field? Does its magnitude change? Does its direction change? Explain your reasoning.
c. (5 points) How does the y-component of the charge’s initial velocity effect the motion of this point charge as it moves through the uniform magnetic field? Does its magnitude change? Does its direction change? Explain your reasoning.
d. (5 points) Use your answers from parts 1b & 1c to explain why the path of this point charge is helical (corkscrew-shaped). Explain your reasoning.
e. (2.5 points) Determine the radius of the circular part of the point charge’s helical path.
In: Physics
Consider an economy with three people and two goods, one public (g) and one private (x). The utility functions for the three people are UA = xA +20lng, UB = xB +30lng, and UC = xC +10lng. The marginal cost of g is constant at 10. According to the Samuelson condition, what is the socially efficient amount of the public good in this economy? Explain why the Samuelson condition picks out the efficient amount of a public good.
In: Economics
According to the National Institute on Alcohol Abuse and Alcoholism (NIAAA), and the National Institutes of Health (NIH), 41% of college students nationwide engage in “binge drinking” behavior, having 5 or more drinks in one occasion during the past two weeks. A college president wonders if the proportion of students enrolled at her college that binge drink is actually different than the national proportion.
In a commissioned study, 348 students are selected
randomly from a list of all students enrolled at the college. Of
these, 118 admitted to having engaged in binge
drinking.
In: Statistics and Probability
(Based on Alton Bridge Video Clip) Large construction projects, like buildings and bridges, are some of the most complex projects to manage. The construction of the bridge from
Alton, Ill. to St. Louis provides an excellent example of a complex project. Describe three challenges the Alton Bridge project had faced and how they were resolved?
In: Operations Management