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
2.ssay 1: Person I Admire
Purpose
This essay assignment is the culmination of all your previous work in this module. You have
...
in this module. You have already engaged in the beginnings of the writing process of this essay. You have:
Brainstormed ideas (see Chapter 11 in SMG) about the essay in the Discussion Board.
Condensed your ideas down into manageable points around a working thesis.
Displayed knowledge of Description essays from Learning Activities
Drafted a Writing Activity (WA2) about this Description essay.
Consulted with a writing tutor to find areas of strength and areas of improvement.
Finally, you will now compose the final draft of a description essay that:
contains a clear thesis
identifies clear points to support your thesis
engages in critical thought about the subject chosen
uses 2-4 main ideas (points) that support your overall essay thesis
allows you to expand on your chosen topic
This essay assignment represents the first steps in writing any written essay for any academic course. The idea of thesis and support are the cornerstones of all essays. They represent the last part of the writing process. However, you may still revise your essay before final submission. This form of essay writing is the basis for all other academic writing pursuits. This skill translates to almost all careers that require critical thinking, critical reading, and responding in writing. Practicing "how to" write an essay carries over into any field's task of "what" you need to write. This skill will help with all formal writing.
Task
Write a 900-word essay, in MLA format, about a person or fictional character in whom you have an interest.
Select a subject (person or fictional character you admire)
Look to your Discussion (D1) and Writing Activity 2 (WA2) for your subject
The person may be current or historical
Some fictional characters have positive traits that can be identified.
Select several (2-4) traits about the person or character that you admire and write about these. These will be the essay's main ideas.
Biographical information should be used only to support claims.
Your essay should focus on the traits you admire. Do not write a biography or tell a story.
Example of what not to do: This person was born in 1979. They were born in middle Tennessee. They went to elementary school is 1985. They graduated in 1998.
Instead, follow this example: This person was born in middle Tennessee. Entering elementary in school in 1985 was hard for them. They never felt that they belonged in kindergarten. However, they persevered, learning that school was a place for them to grow and be themselves.
Focus on the "why" you admire them instead of a list of traits. In the above example, perseverance and learning to be themselves are the traits the writer of the essay admires.
Organize your main ideas to establish the essay's pattern of organization.
Your main ideas (traits you have chosen) need to be clearly organized.
Decide in what order you wish to discuss these main ideas (traits)
This organization needs to be presented in your introduction, preferably as the last sentence of your introduction in the thesis statement.
Note: your thesis is generally the last sentence in your introduction, but it not a requirement.
Follow this structure throughout the rest of the essay.
Always check to see if your main ideas/topic sentences, in each paragraph, relate back to your thesis statement.
Compose 5 well-developed paragraphs that support a clear thesis statement that is arguable.
5 paragraph minimum
introduction paragraph
introduces your essay and presents your thesis
three body paragraphs
Each paragraph contains one of your chosen admirable traits about your subject
expressed in a topic sentence in your paragraph
Each trait needs to transition to the next one in the next paragraph
look to your chosen pattern of development
conclusion paragraph
rephrases your traits into one last paragraph
reflects the earlier thesis, but with the knowledge of your traits expressed throughout the essay
This essay is a basic form of an argument essay. The essay should make an argument such as that the person or character selected is worthy of admiration because of the traits selected.
Criteria for Success
A successful essay:
Meets basic requirements of the assignment
Has been written by the student submitting the essay, for this class, and for this semester,
Does not contain plagiarism of any kind
Academic dishonesty is an offense of the NSCC Student Code of Conduct, punishable by a failing grade or zero
Has a clear thesis, main ideas, and pattern of organization
Has been carefully edited and proofread to minimize grammatical and other editing errors
These can be remedied by editing and with Writing Tutor visits and peer reviewing
Follows MLA style and guidelines (spacing, indent, margins, etc. )
The essay will be graded with the Grading Rubric for Essays. Please familiarize yourself with this rubric before you submit your essay. Here is the condensed version of the rubric:
View More
3.
The following is an excerpt from a letter sent by Henry Wallace to President Truman, July 23, 1946. From the
...
. From the Harry S Truman Papers, Harry S Truman Library, Independence, Missouri. Henry Wallace, a former Vice President of the United States, was a critical observer of US policies during the start of the Cold War. He believed US actions were as much to blame as Soviet actions in the starting of the Cold War.
“How do American actions since V-J Day appear to other nations? I mean by actions the concrete things like $13 billion for the War and Navy Departments, the Bikini tests of the atomic bomb and continued production of bombs, the plan to arm Latin America with our weapons, production of B-29s and planned production of B-36s, and the effort to secure air bases spread over half the globe from which the other half of the globe can be bombed. I cannot but feel that these actions must make it look to the rest of the world as if we were only paying lip service to peace at the conference table.
These facts rather make it appear either (1) that we are preparing ourselves to win the war which we regard as inevitable or (2) that we are trying to build up a predominance of force to intimidate the rest of mankind. How would it look to us if Russia had the atomic bomb and we did not, if Russia had 10,000-mile bombers and air bases within a thousand miles of our coastlines, and we did not?
Our basic distrust of the Russians, … stems from differences in political and economic organization…I am convinced that we can meet that challenge as we have in the past by demonstrating that economic abundance can be achieved without sacrificing personal, political and religious liberties.
Our actions to expand our military security system-such steps as extending the Monroe Doctrine to include the arming of the Western Hemisphere nations, our present monopoly of the atomic bomb, our interest in outlying bases and our general support of the British Empire-appear to them as going far beyond the requirements of defense.”
Henry A. Wallace, Letter Sent to President Truman, July 23, 1946
Primary Source Document Questions:
1) What is the main idea contained within this document? (4 marks)
2) What is going on in the country/world when this document was written? (3 marks)
3) Is this document a reliable source? Why or why not? (Is there bias?) (3 marks)
4) What are 2 facts that you have learned in class or on your own that you can connect to this document? (2 marks)
5) How does this primary source contribute to our understanding of the time frame and/or history? (3 marks)
View More
4.
Take me as someone who has always had an interest in air pollution, but doesn't have the time to learn
...
earn about it independently. I am hiring you to learn all that you can about it and put together a report that will summarize all the information so that I can learn as much as I can in as little time as possible. Here is what you need to include in your report:
An explanation of air pollution. What is air pollution? //
Explain 4 causes of air pollution.
Explain 2 sources of air pollution. What are the toxins or pollutants that contaminate the air?
Explain at least 5 effects of air pollution on human health and/or the environment.
Explain 3 solutions to stopping air pollution. What can be done by the government or private organizations?
Work cited page should also be included, listing all the sources you used to get your information.
THIS REPORT SHOULD BE TYPED AND ORGANIZED IN 5 OR MORE PARAGRAPHS. READ THE RUBRIC BELOW CAREFULLY TO UNDERSTAND HOW THIS PROJECT WILL BE GRADED!!
WORKS CITED PAGE
General guidelines for citing sources:
List entries alphabetically by author (if no author list title first)
Separate entries with periods
General format:
Author, last name first. "Webpage title." Website title. Date published/updated. Organization/publisher. Date accessed. < URL >
Example:
Landsberger, Joseph. “Citing Websites." Study Guides and Strategies . 12 May 2005. University of
X. 13 May 2005. < http://www.studygs.net/citation.htm >.
These websites will format your citations for you: http://citationmachine.net/ & http://easybib.com/
**You should use google slides or powtoons to put together your information. You should have a minimum of 6 slides not including the title slide with your name.** DUE FRIDAY, APRIL 3, 2020
Rubric
Criteria
Points
Information Included
Three or more required elements are missing (not including additional facts).
(20 points)
1 or 2 required elements are missing (not including additional facts).
(30 points)
All required information is present, but no additional information is given.
(40 points)
All required information is present, including two additional facts.
(50 points)
_________
Quality of information
Information has little or nothing to do with the main topic OR sections do not provide any supporting detail or explanation.
(5 points)
Information clearly relates to the topic, but some sections are lacking detail and explanation.
(10 points)
Information clearly relates to the main topic and all sections include some supporting detail and explanation.
(15 points)
Information clearly relates to the main topic and all sections include significant supporting details and explanation.
(20 points)
________
Format
Title page is not present at all AND/OR there are errors in typing, spacing, no picture, etc.
(5 points)
Product has improperly formatted title page AND/OR no picture or not creative.
(8 points)
Product has incorrectly formatted title page and has pictures.
(12 points)
Product has a title page in the proper format, has pictures and is creative.
(15 points)
________
Spelling/Grammar
5 or more grammatical, spelling or punctuation errors present throughout the product.
(2 points)
3-4 grammatical, spelling or punctuation errors present throughout the product.
(3 points)
1-2 grammatical, spelling or punctuation errors present throughout the product.
(4 points)
No grammatical, spelling or punctuation errors present throughout the product.
(10 points)
________
Works Cited
Works Cited page not present.
(2 points)
All sources are documented with 3-4 errors in format OR Works Cited is not done a separate page.
(3 points)
Works Cited is done on a separate page and all sources are documented with 1-2 errors in format.
(4 points)
Works Cited is done on a separate, properly headed page with all sources documented in proper Works Cited format.
(5 points)
________
Total
_____/100
View More
5.I need answers on 2 questions based on the text of Waltz, Susan. "Reclaiming and Rebuilding the History of the
...
ory of the Universal Declaration of Human Rights." Third World Quarterly 23, no. 3 (2002): 437-48. (in the file attached) This are the questions:
Question 1 Waltz discusses four political myths about the Universal Declaration of Human Rights, and demonstrates they are misleading. What is her main argument? In your answer identify the hypothesis that Waltz targets.
Question 2 Does Waltz discredit this hypothesis or not? Keep in mind that a hypothesis aims to explain something.
View More
6.Task 1
You are asked to carry out a study on behalf of a business analytics specialised consultancy on a subsample
...
on a subsample of weekly data from Randall’s Supermarket, one of the biggest in the UK. Randall’s marketing management team wishes to identify trends and patterns in a sample of weekly data collected for a number of their loyalty cardholders during a 26-week period. The data includes information on the customers’ gender, age, shopping frequency per week and shopping basket price. Randall’s operates two different types of stores (convenient stores and superstores) but they also sell to customers via an online shopping platform. The collected data are from all three different types of stores. Finally, the data provides information on the consistency of the customer’s shopping basket regarding the type of products purchased. These can vary from value products, to brand as well as the supermarket’s own high-quality product series Randall’s Top. As a business analyst you are required to analyse those data, make any necessary modifications in order to determine whether for any single customer it is possible to predict the value of their shopping basket.
Randall’s marketing management team is only interested in identifying whether the spending of the potential customer will fall in one of three possible groups including:
• Low spender (shopping basket value of £25 or less)
• Medium Spender (shopping basket value between £25.01 and £70) and
• High spenders (shopping basket greater than £70)
For the purpose of your analysis you are provided with the data set Randall’s.xls. You have to decide, which method is appropriate to apply for the problem under consideration and undertake the necessary analysis. Once you have completed this analysis, write a report for the Randall’s marketing management team summarising your findings but also describing all necessary steps undertaken in the analysis. The manager is a competent business analyst himself/herself so the report can include technical terms, although you should not exceed five pages. Screenshots and supporting materials can be included in the appendix.
Requirements
After completing your analysis, you should submit a report that consists of two parts. Part A being a non-technical summary of your findings and Part B a detailed report of the analysis undertaken with more details.
Part A: A short report for the Head of Randall’s Marketing Management (20 per cent). This should briefly explain the aim of the project, a clear summary and justification of the methods considered as well as an overview of the results.
Although, the Head of Randall’s Marketing Management team who will receive this summary is a competent business analytics practitioner, the majority of the other team members have little knowledge of statistical modelling and want to know nothing about the technical and statistical underpinning of the techniques used in this analysis. This report should be no more than two sides of A4 including graphs, tables, etc. In this report you should include all the objectives of this analysis, summary of data and results as well as your recommendations (if any).
Part B: A technical report on the various stages of the analysis (80 per cent).
The analysis should be carried out using the range of analytics tools discussed:
• SPSS Statistics
Ensure that the exercise references:
• Binary and multinomial logistic regression
• Linear vs Logistic regression
• Logit Model with odds Ratio
• Co-efficients and Chi Squared
• MLR co-efficients
• Assessing usefulness of MLR model
• Interpreting a model
• Assessing over-all model fit with Psuedo R-Squared measures
• Classification accuracy (Hit Ratio)
• Wald Statistic
• Odd ratio exp(B)
• Ratio of the probability of an event happening vs not happening
• Ratio of the odds after a unit change in the predictor to the original odds
• Assumptions
• Residuals analysis
• Cook’s distance
• DfBeta
• Adequacy (with variance inflation factor VIF and tolerance statistic)
• Outliers and influential points cannot just be removed. We need to check them (typo? – unusual data?)
• Check for multicollinearity
• Parsimony
Write a short and concise report to explain the technical detail of what you have done for each step of the analysis.
The report should also cover the following information:
• Any type of analysis that might be useful and check whether the main assumptions behind the analyses do not hold or cannot be
• Give evidence of the understanding of the statistical tools that you are using. For example, comment on the model selection procedure and the coefficient interpretation, e.g. comment on the interpretation of the logistic regression coefficients if such a method is used and provide an example of
• Conclusions and explanation, in non-technical terms, of the main points
View More
8.Suppose you are an American journalist in 1939. You have been exposed to both
government propaganda and unofficial information about the
...
and unofficial information about the reality of life under
the totalitarian governments of Italy, Nazi Germany, Spain, and the Soviet Union
during the period between World War I and World War II.
Write an article for a news magazine aimed at American citizens who are
unfamiliar with the details of life in Europe. Use your Reading Notes, the
information you gathered on Student Handout I, and the “secret” information
you learned from your classmates.
Follow these guidelines:
a. Give your article a title that will grab your audience’s attention.
b. Structure your article this way:
Introduction: Provide a brief introduction to your experience attending the
“International Fascist Art Exhibition.”
Body Paragraph 1: Explain what totalitarian governments in Europe want
their citizens and foreigners to believe about their leaders and policies.
Body Paragraph 2: Describe what life is really like under these totalitarian
governments.
Body Paragraph 3: Explain what you think accounted for the rise of
totalitarian states after World War I, including how the leaders of these
states gained and kept their power.
Conclusion: Evaluate the rise of totalitarian states and predict the impact
you think their existence will have on world affairs.
c. Create a drawing or cartoon that illustrates one of the main ideas of your
article.
d. Include references to and examples from all four countries studied in this
lesson: Italy, Nazi Germany, Spain, and the Soviet Union.
e. Make your article about two pages in length. Type or write your final draft
neatly in ink.
View More
10.To gain experience with the operations involving binary search trees. This data structure as linked list uses dynamic memory allocation
...
list uses dynamic memory allocation to grow as the size of the data set grows. Unlike linked lists, a binary search tree is very fast to insert, delete and search.
Project Description
When an author produce an index for his or her book, the first step in this process is to decide which words should go into the index; the second is to produce a list of the pages where each word occurs. Instead of trying to choose words out of our heads, we decided to let the computer produce a list of all the unique words used in the manuscript and their frequency of occurrence. We could then go over the list and choose which words to put into the index.
The main object in this problem is a "word" with associated frequency. The tentative definition of "word" here is a string of alphanumeric characters between markers where markers are white space and all punctuation marks; anything non-alphanumeric stops the reading. If we skip all un-allowed characters before getting the string, we should have exactly what we want. Ignoring words of fewer than three letters will remove from consideration such as "a", "is", "to", "do", and "by" that do not belong in an index.
In this project, you are asked to write a program to read any text file and then list all the "words" in alphabetic order with their frequency together appeared in the article. The "word" is defined above and has at least three letters.
Note:
Your result should be printed to an output file named YourUserID.txt.
You need to create a Binary Search Tree (BST) to store all the word object by writing an insertion or increment function. Finally, a proper traversal print function of the BST should be able to output the required results.
The BST class in the text can not be used directly to solve this problem. It is also NOT a good idea to modify the BST class to solve this problem. Instead, the following codes are recommended to start your program.
//Data stored in the node type
struct WordCount
{
string word;
int count;
};
//Node type:
struct TreeNode
{
WordCount info;
TreeNode * left;
TreeNode * right;
};
// Two function's prototype
// Increments the frequency count if the string is in the tree
// or inserts the string if it is not there.
void Insert(TreeNode*&, string);
// Prints the words in the tree and their frequency counts.
void PrintTree(TreeNode* , ofstream&);
//Start your main function and the definitions of above two functions.
Sample Run
Please type the text file name: Lincoln.txt
Please give the output text file name: mus11.txt
You are done! You can open the file "mus11.txt" to check.
Press any key to continue
------------------------------------------------------------------------------------------------------------------------------------------------
lincoln.txt---
The Gettysburg Address
Gettysburg, Pennsylvania
November 19, 1863
Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in
Liberty, and dedicated to the proposition that all men are created equal.
Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and
so dedicated, can long endure. We are met on a great battle-field of that war. We have come to dedicate
a portion of that field, as a final resting place for those who here gave their lives that that nation
might live. It is altogether fitting and proper that we should do this.
But, in a larger sense, we can not dedicate -- we can not consecrate -- we can not hallow -- this ground.
The brave men, living and dead, who struggled here, have consecrated it, far above our poor power to add
or detract. The world will little note, nor long remember what we say here, but it can never forget what
they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they
who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great
task remaining before us -- that from these honored dead we take increased devotion to that cause for
which they gave the last full measure of devotion -- that we here highly resolve that these dead shall not
have died in vain -- that this nation, under God, shall have a new birth of freedom -- and that government
of the people, by the people, for the people, shall not perish from the earth.
------------------------------------------------------------------------------------------------------------------------------------------------
mus11.txt
1863 1
Address 1
But 1
Four 1
Gettysburg 2
God 1
Liberty 1
November 1
Now 1
Pennsylvania 1
The 3
above 1
add 1
advanced 1
ago 1
all 1
altogether 1
and 6
any 1
are 3
battle-field 1
before 1
birth 1
brave 1
brought 1
but 1
can 5
cause 1
civil 1
come 1
conceived 2
consecrate 1
consecrated 1
continent 1
created 1
dead 3
dedicate 2
dedicated 4
detract 1
devotion 2
did 1
died 1
earth 1
endure 1
engaged 1
equal 1
far 2
fathers 1
field 1
final 1
fitting 1
for 5
forget 1
forth 1
fought 1
freedom 1
from 2
full 1
gave 2
government 1
great 3
ground 1
hallow 1
have 5
here 8
highly 1
honored 1
increased 1
larger 1
last 1
little 1
live 1
lives 1
living 2
long 2
measure 1
men 2
met 1
might 1
nation 5
never 1
new 2
nobly 1
nor 1
not 5
note 1
our 2
people 3
perish 1
place 1
poor 1
portion 1
power 1
proper 1
proposition 1
rather 2
remaining 1
remember 1
resolve 1
resting 1
say 1
score 1
sense 1
seven 1
shall 3
should 1
struggled 1
take 1
task 1
testing 1
that 13
the 9
their 1
these 2
they 3
this 4
those 1
thus 1
under 1
unfinished 1
vain 1
war 2
what 2
whether 1
which 2
who 3
will 1
work 1
world 1
years 1
View More