1.CSE 1300
Problem Solving Practice Conditional Statements
Question 1: Student Fees
All KSU students pay fees in addition to their tuition.
Using the code
...
nts pay fees in addition to their tuition.
Using the code provided below as a starting point, write a conditional statement that determines how much a student will pay in fees.
• Students registered for 1 – 4 hours pay $843 in student fees.
• Students enrolled in 5 or more hours pay $993 in student fees.
The program should also display a message to students who have not enrolled in any classes: “You are not enrolled in any classes right now.”
NOTE: You must use the variables included in the code snippet get credit for this question.
import java.util.Scanner;
class Main {
public static void main(String[] args) {
int creditHours;
int fees = 0;
Scanner myScanner = new Scanner(System.in);
System.out.print("Please enter the number of credit hours you are taking this term: "); creditHours = myScanner.nextInt();
myScanner.close();
//YOUR CODE GOES HERE
} }
Break the Problem Down
Answer the following questions, then use the information to write your code.
What are the inputs in the pseudocode above? (INPUT)
What are we storing in the pseudocode above? (MEMORY)
What calculations are needed? (PROCESSES)
What needs to be displayed to the user?
(OUTPUT)
How many conditions are there in your problem statement?
What are they?
Does something need to happen if the condition(s) are not met?
What type of conditional statement do you need?
Solution in Java
Problem 2: Block Tuition
The cost of KSU’s tuition is determined by the number of credit hours a student enrolls in.
Using the chart below, write a conditional statement (ONLY) that sets the value of a tuition variable to what that student will owe.
NOTE: For this problem you can assume that all students are enrolled in a minimum of 12 hours.
Number of Credit Hours 12
13
14
15 or more
Cost (in USD) $2224 $2410 $2595 $2718
Break the Problem Down
Answer the following questions, then use the information to write your code.
What do we need to store? (MEMORY)
What are the inputs in the problem statement above? (INPUT)
What calculations are needed? (PROCESSES)
What needs to be displayed to the user?
(OUTPUT)
How many conditions are there in your problem statement?
What are they?
Does something need to happen if the condition(s) are not met?
What type of conditional statement do you need?
Solution in Java
Problem 3: Class Standing
Undergraduate students will be classified based on the number of earned institutional hours.
• Freshman:
• Sophomore:
• Junior:
• Senior:
0 - 29 hours
30 - 59 hours 60 - 89 hours
90 hours or more
Write a complete program that prompts the user for the number of credit hours they have completed. Write a conditional statement that prints out their class standing based on the information they provided.
Sample Output
Break the Problem Down
Answer the following questions, then use the information to write your code.
What do we need to store? (MEMORY)
Please enter the number of credit hours you have earned: 29 You are a freshman.
What are the inputs in the problem statement above? (INPUT)
What calculations are needed? (PROCESSES)
What needs to be displayed to the user?
(OUTPUT)
How many conditions are there in your problem statement?
What are they?
Does something need to happen if the condition(s) are not met?
What type of conditional statement do you need?
Solution in Java
Problem 4: Maximum Course Load
KSU’s policy on maximum course loads during the academic year is as follows:
A student in good standing may register for up to 18 hours. The Registrar may approve up to 21 hours for students with an institutional GPA of 3.5 or higher. Students
Write a complete program that prompts the user for the number of credit hours they have signed up for. Write the necessary conditional statement(s) to address the stipulations in KSU’s policy. Once the maximum number of hours is determined, display a message to the user that states “You may enroll in X credit hours this semester.” where X is the number of credit hours determined by your program.
Sample Output
Break the Problem Down
Answer the following questions, then use the information to write your code.
What do we need to store? (MEMORY)
Please enter your GPA: 3.75
You may enroll in up to 21 credit hours this semester.
What are the inputs in the problem statement above? (INPUT)
What calculations are needed? (PROCESSES)
What needs to be displayed to the user?
(OUTPUT)
How many conditions are there in your problem statement?
What are they?
Does something need to happen if the condition(s) are not met?
What type of conditional statement do you need?
Solution in Java
Problem 5: First-Year Seminar
All first-year full-time students entering Kennesaw State University with fewer than 15 semester hours are required to complete a First-Year Seminar. Students with 30 or more credit hours are not eligible to enroll in a First-Year Seminar.
Write a complete program that prompts the user for the number of credit hours they have completed. Write the necessary conditional statement(s) to address the stipulations in KSU’s policy.
When you run your program, it should display one of the following messages to the screen:
• You must enroll in First-Year Seminar.
• You do not have to take First-Year Seminar.
• You are not eligible for First-Year Seminar.
Sample Output
Break the Problem Down
Answer the following questions, then use the information to write your code.
What do we need to store? (MEMORY)
Enter the number of credit hours have you completed: 30
You are not eligible for First-Year Seminar.
What are the inputs in the problem statement above? (INPUT)
What calculations are needed? (PROCESSES)
What needs to be displayed to the user?
(OUTPUT)
How many conditions are there in your problem statement?
What are they?
Does something need to happen if the condition(s) are not met?
What type of conditional statement do you need?
Solution in Java
View More
4.students are expected to research and compose a paper based on the application of concepts and theories examined in class.
...
ies examined in class. This paper is not a literature review, though a literature review is part of your work. As this course takes place in a compressed timeline, I provided some suggestions for research topics. Feel free to use one of these as a springboard or propose your own.
At the end of the second week of class, students submit a three-page research paper prospectus. A research prospectus is a preliminary plan for conducting a study. This is not a detailed and technical research proposal, but rather, an analysis of the issues likely confronted in such a study. In essence, it is a preliminary proposal of work.
Research Paper Prospectus Elements
To complete the Research Paper Prospectus, consider the following elements. While the prospectus is limited to three pages of body content, remember, students must cover each of these areas as relevant to the plan for research:
Research Problem. What is the research problem? A problem is a situation when left untreated, produces a negative consequence for a group, an institution, or a(n) individual(s). What makes it a problem? For whom? Who says so?
Assumptions. On what assumptions is the work based? Which assumptions are verifiable in literature? Which assumptions are speculative?
Theoretical Issues. What theoretical issues arise from the study? For example, "theoretically," how is the problem and suspected results explained to other scholars? Is there a behavior view? A social systems view? Are there other theoretical orientations to consider in the study's design?
Literature Review. What, in general, does the literature say about the topic? While more development is expected for the final paper, a review of major theories, research, and writers in the field is needed.
Research Questions. Based on the problem, what are the research questions to be answered? How and why will answering the questions contribute to solving the research problem? Remember....a research question can only be answered with empirical data or information.
General Research Plan. In general, what research is necessary to answer the research question. What kind of data is needed? Specify the type, such as surveys, observations, or interviews. Who is to be studied and why? How is the data reduced and made sense of? How is the quality of the data assured?
Anticipated Difficulties and Pitfalls. What kind of difficulties and pitfalls are expected in a study of this nature? What can be done to prevent them or minimize their effects?
Anticipated Benefits. Who will benefit from the fact this research is undertaken? How? Why? Who might be disturbed by this proposed study? How? Why?
Paper Format Requirements
The Research Paper Prospectus is presented in standard APA 7 format, with a cover page, running head, body, and references list. The cover page and references do not count toward the three-page requirement. The body uses headers and in-text citations in the manner prescribed by APA. Students should include any references they know at the time they submit the prospectus, though it is expected the references may change or increase in number. Full and complete adherence to APA is required.
APA Basics
As APA format is the rule, remember the formatting rules shown on the Sample Paper (Links to an external site.):
Times New Roman, 12pt
1" margins on all sides
Double spaced, with extra line spaces removed (see below)
Page numbers in the upper right
Two spaces after concluding punctuation
150-250 word abstract with keywords
APA-style in-text citations and quote format. Use the Purdue OWL in-text citation information (Links to an external site.)to help you.
Alphabetical (by author) reference page with correct reference format. DO NOT trust the reference generator in your word processing program. It is WRONG! Use the Purdue OWL references information (Links to an external site.)to correctly structure references and do so manually.
View More
5.The regression specified for private investment is I = α1 + α2 Y + α3 CRD + u . The
...
estimating the regression are presented below. The sample covers the annual series spanning from 1981-2018.
Î1 = 2.4 + 0.75 Y1 + 0.45 CRD1
(1.02) (0.26) (0.12)
R2 = 0.78 D-W-d= 1.15 where I, Y and represent real private investment, real GDP and real credits respectively.
a) Suppose you would like to perform the test for the first order autocorrelation using the LM type test technique. Define the auxiliary regression to this end. Also suppose you found R-squared from the auxiliary regression to be 0.62, perform the LM test for the first order autocorrelation
b)Suppose you confirmed that there is a first order autocorrelation problem in the error term, show how you use the GLS (Cochrane-Orchutt two step method) method to overcome the problem
View More
6.A bank claims that omitting the annual credit card fee for customers who charge at least $2500 in a year
...
year will increase the amount charged on its credit card. The bank makes this offer to a random sample of 225 of its credit card customers. It then compares how much these customers charge this year with the amount that they charged last year. The mean increase in the sample is $560, with sum of squares SS= $1,417,250. Is there significant evidence at 1% level that the mean amount charged increases under the no-fee offer? First, in the blank below report the observed value of the test statistic (e.g., observed z, observed t, or observed χ2 you will use for hypothesis testing
2. Enter the critical value for the statistic and degrees of freedom. Do we reject H0 or fail to reject
View More
7.2.
PODStat5 4.E.031.
The standard deviation alone does not measure relative variation. For example, a standard deviation of $1 would be considered
...
, a standard deviation of $1 would be considered large if it is describing the variability from store to store in the price of an ice cube tray. On the other hand, a standard deviation of $1 would be considered small if it is describing store-to-store variability in the price of a particular brand of freezer. A quantity designed to give a relative measure of variability is the coefficient of variation. Denoted by CV, the coefficient of variation expresses the standard deviation as a percentage of the mean. It is defined by the formula CV = 100(s/ x ). Consider two samples. Sample 1 gives the actual weight (in ounces) of the contents of cans of pet food labeled as having a net weight of 8 oz. Sample 2 gives the actual weight (in pounds) of the contents of bags of dry pet food labeled as having a net weight of 50 lb. There are weights for the two samples.
Sample 1 7.7 6.8 6.5 7.2 6.5
7.7 7.3 6.6 6.6 6.1
Sample 2 50.7 50.9 50.5 50.3 51.5
47 50.4 50.3 48.7 48.2
(a) For each of the given samples, calculate the mean and the standard deviation. (Round all intermediate calculations and answers to five decimal places.)
For sample 1
Mean
Standard deviation
For sample 2
Mean
Standard deviation
(b) Compute the coefficient of variation for each sample. (Round all answers to two decimal places.)
CV1
CV2
View More
8.ATTACHED ARE GRAPHS
QUESTION 1
Q1 to Q4
The job satisfaction for the four occupational groups were used (lawyer, physical therapist, cabinetmakers, and
...
oups were used (lawyer, physical therapist, cabinetmakers, and system analysts). The results obtained for a sample of 5 individuals from each groups. Using the "ANOVA Output" below, please answer the following questions ( Use the significance level 5%).
Q1. The value of the test statistic is ____________
QUESTION 2
Q2. The p- value of the test is _________________
QUESTION 3
Q3. At the 5% significance level, the null hypothesis is rejected if the value of the F statistics is >= _________________
QUESTION 4
Q4. Interpret the ANOVA result at the 5% significance level. Is there any difference in the job satisfaction among the four occupational groups? Answer either yes or no. Explain the reason of your answer statistically.
QUESTION 5
Data from a Trucking Company is Southern California were utilized to examine the relationship among total daily travel time (y), miles to traveled (X1), and the number of deliveries (x2). Based on the "Regression Output" below, please answer the following questions.
Q5. The number of sample used in this regression analysis is______________
QUESTION 6
Q6. What is the value of the coefficient of determination?
QUESTION 7
Q7. What is the F test statistic value for the regression model significane test?
QUESTION 8
Q8. What is the predicted travel time for X1 =95, and X2= 6?
QUESTION 9
Q9. Is X2 (number of deliveries) related to Y (travel time)? Answer either yes or no. Explain the reason of your answer statistically.
ATTACHED ARE GRAPHS
View More
9.1) A hypothetical element exists as two isotopes: I = 42.00 amu and II = 49.00 amu. If the percent
...
bundance of isotope I is (1.94x10^1)%, what would be the calculated atomic mass (in amu)?
2) A hypothetical element exists as two isotopes: I = 78.00 amu and II = 84.00 amu. If the atomic mass of this element is found to be 80.33 amu, which isotope must be more abundant?
3) If the hypothetical polyatomic ion ThOM2- is called "thomite", what would be the formula and name of the acid formed by this ion?
4) How many atoms of hydrogen are there in a sample of (4.00x10^2) grams of NH3(g)?
5) How many O (oxygen) atoms are there in (6.40x10^2) grams of H3PO4?
6) How many moles of fluorine atoms are there in (5.80x10^2) grams of SF4?
7) When 3.50 g of titanium (Ti) reacts with oxygen, the resulting oxide compound weighs 5.84 g. What is the empirical formula of this oxide?
8) How many moles of molecules are there in (6.70x10^2) grams of CH4?
9) A chemical is found to be 80.0% C and the rest is H. If the molar mass of this chemical is known to be 90.2 g/mol, what is the molecular formula?
View More
10. When to balance dice are rolled, there are 36 possible outcomes. Find the probability that the sum is
...
is a multiple of three or greater than eight.
A certain game consist of rolling a single fair die and pays off as follows nine dollars for a six, six dollars for a five, one dollar for four and no payoffs otherwise.Find the expected winnings for this game.
A fair die is rolled four times. A 6 is considered success While all other outcomes are failures find the probability of three successes.
A pet store has nine puppies including 4 poodles 3 terriers and 2 retrievers. If Rebecca an errand in that order each select one puppy at random without replacement find the probability that Aaron select a retriever given that from last Rebecca selects a poodle.
Experience shows that a ski lodge will be for (166 guests) if there is a heavy snowfall in December, well only partially full (52 guests) With a light snowfall. What is the expected number of guests if the probability for a heavy snowfall is 0.40? I assume that heavy snowfall and light snowfall are the only two possibilities.
A pet store has six puppies Including two poodles two Terriers and to retrievers. If Rebecca and Aaron in that order each select one puppy random with replacement (They both may select the same one) Find the probability That Rebecca selects a terrier and Aaron selects a retriever.
Three married couples arrange themselves randomly in six consecutive seats in a row. Determine (A) the number of ways the following event can occur, And (B) the probability of the event. (The denominator of the probability fraction will be 6!=720, The total number of ways to arrange six items ). Each man was that immediately to the right of his wife.
A coin is tossed five times. Find the probability that all our heads. Find the probability that at least three are heads.
A certain prescription drug is known to produce undesirable facts and 35% of all patients due to drug. Among a random sample of a patient using a drug find the probability of the stated event. Exactly 5 have undesired effects.
10,000 raffle tickets are sold. One first prize of 1600, for second prizes of 800 each, And 9/3 prizes of 300 each or to be awarded with all winners selected randomly. If you purchase one ticket what are your expected winnings.
Suppose a charitable organization decides to Raise money by raffling A trip worth 500. If 3000 tickets are sold at one dollar each find the expected net winnings for a person who buys one ticket. Round to the nearest cent
Three men and seven women are waiting to be interviewed for jobs. If they are selected in random order find the probability that all men will be interviewed first
A fair diet is rolled. What is the probability of rolling on our number or a number less than three.
The pet store has 15 puppies, including five poodles, five Terriers, and five retrievers. If Rebecca and Aaron, in that order, select one puppy at random without replacement, find the probability that both select a poodle
Beth is taking a nine question multiple-choice test for which each question Has three answer choices, only one of which is correct. Beth decides on answering By rolling a fair die And making the first answer choice if the die shows one or two, The second If the die shows three or four, and the third if the die shows five or six. Find the probability of the stated event. Exactly 6 correct answers
For the experiment of drawing a single card from a standard 52 card deck find (a) the probability and (b) the odds are in favor that they do not drive six
View More