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.Here is the topic, along with the assignment instructions:
Doctors who sit on the National Comprehensive Cancer Network (NCCN) guideline panels
...
hensive Cancer Network (NCCN) guideline panels are allowed to receive up to $20,000 per year in payments from a single pharmaceutical or medical device company or $50,000 in the aggregate per year. Specifically, the NCCN website states the following: "If an NCCN Guidelines Panel Member or prospective Member or an NCCN Guidelines Steering Committee Member or prospective Member has an equal to or greater than $20,000 conflicting interest from at least one single external entity, including the sum of income and equity holdings from said entity, or if their aggregate conflicting interest from all external entities is equal to or greater than $50,000 per year, the Member or proposed appointee will be deemed ineligible for continued service or for appointment."
Some experts claim that these thresholds are way too high, and that NCCN guideline panelists should only be doctors who don't receive any money or funding from pharma whatsoever. But Dr Robert Carlson, the CEO of NCCN, defends the organization's current policy saying that tightening the rules would lead to exclusion of best experts in oncology and ultimately affect the quality of the guidelines.
Write a research paper that examines this question: Should NCCN panelists be allowed to receive any money or funding from pharmaceutical or/and medical device companies while serving on the panels? Support your stance on the issue with solid evidence from eight or more reputable sources and use APA citation style, 7th edition, for the assignment. Make sure your paper includes a title page on page 1 and an abstract on page 2, and is formatted in accordance with APA. Finally, please include an "Opposition" section in your paper where you will acknowledge and explain the views of people who would disagree with you.
View More
7.I am looking for someone who is familiar with water resources engineering. I have to be able to determine size
...
rmine size of piping for a water, wastewater, and stormwater system for an addition to a building on our campus. I am given maps of the existing conditions. I have calculated the new water demand which has to be used to determine the size of the pipes, though I am not completely sure if I did that right. I have a lot of information which I have compiled into a one drive file that I can share. I am able to help provide any information that is necessary since I am familiar with what the files contain. I have attached a document which explains everything that I need to do. I am able to use the existing network for the most part so routing of it should be easy. The part I am unsure about is determining the size of the pipes. For the water, I believe I can use mannings equation. For wastewater, I am unsure. For stormwater, I am to use the rational method and I have an excel tool which makes that easy for someone who knows what they are doing. Please help ASAP. I have to be done with this before tuesday afternoon. I am in central time zone(11:20pm right now).
View More
8.i need a participation post answered please it needs to be 100 word response and substantive question
here is the post
Good
...
n
here is the post
Good evening Joseph,
Your forum post this week sparked my interest because of your two debatable topics. Your week 5 topic of "Should churches be taxed or exempted", will be an interesting read. As a person who grew up in the church and seeing what it offers, I am for churches being tax exempt. The money saved from taxes in the end helps the community.
Your second debatable really stuck a cord with me. I hate how reliant we as a society we have become on our cell phones. I use mine a lot, but have being trying for a few months now to be less reliant on it. Kids are at school to learn, not be on their cell phones. The teachers should be teaching and paying attention to the students and not on their cell phones. I am curious, when you say banned, so you mean not even on school property, or just not allowed to be used during school hours? My 13 year old son takes his cell phone to school in his back pack, but we have talked to him about when he can use it. It's mainly for after school activities, so he can let us know when he needs to be picked up.
I look forward reading your papers.
Thomas F. Wright
View More
9.: There are four things that you need to do in order to successfully complete this module's discussion questions assignment.
...
on questions assignment. First, if you have not already done so, read pages 381-382 in the textbook. Second, complete the discussion questions that appear below. Please copy and paste the questions onto a Word document; then, type your responses after each question. To view the questions, please scroll down.
Third, in the textbook, read “A Modest Proposal” by Jonathan Swift (pages 214-222) and “How to Raise a Pimp” by Darryl L. Fortson, M.D. (pages 231-233). Fourth, complete the discussion questions regarding “A Modest Proposal” and “How to Raise a Pimp.” Again, please copy and paste the questions onto a Word document; then, type your responses after each question. To view the questions, please scroll down.
Due Date: Please see the Canvas announcement regarding this assignment.
Final Thoughts: Good luck with this assignment. You do not need to write an essay response to each question, so please do not do so. In fact, you should be able to successfully respond to each question in several sentences or a paragraph at most. If you have any questions or concerns, please feel free to e-mail or call me.
Discussion Questions
Pages 381-382
1. On pages 381-382, there is paragraph about tropical fish. Please quote the author’s stated claim exactly as it appears in the paragraph. (Hint: the stated claim is one sentence long.)
2. On pages 381-382, there is paragraph about tropical fish. Since this paragraph is a satire, you know that the stated claim is not what the author truly believes, so please paraphrase the author’s implied claim. (Hint: the implied claim should be one sentence in length.)
3. On page 382, there is paragraph about circuses. Please quote the author’s stated claim exactly as it appears in the paragraph. (Hint: the stated claim is one sentence long.)
4. On pages 381-382, there is paragraph about circuses. Since this paragraph is a satire, you know that the stated claim is not what the author truly believes, so please paraphrase the author’s implied claim. (Hint: the implied claim should be one sentence in length.)
Discussion Questions
“A Modest Proposal” by Jonathan Swift
1. The author of the work is not the same individual who is making the claim. In fact, Swift assumes a persona, the persona of someone he, hopefully, is not. List some of the characteristics of his alter-ego.
2. What is the proposer’s (we will use the word proposer to identify the individual making the claims) attitude toward the beggars he describes in the opening paragraphs?
3. In one sentence, paraphrase the proposer’s stated claim.
4. In one sentence, paraphrase the proposer’s implied claim.
5. According to the proposer, what are some of the issues that need correcting?
6. How does the use of facts and statistics help to bolster the proposer’s credibility?
7. Who will be the beneficiaries of this modest proposal?
8. Identify at least four good things that will come from this modest proposal.
9. Does the proposer address any arguments that might be raised against his modest proposal? If so, how does he address them?
10. Looking at the final paragraph, why does the proposer end his modest proposal in this manner?
11. Who is the intended audience of this satire?
12. Did you enjoy this satire? Why?
13. Does this satire have any relevance for us reading it today? If so, what is it?
Discussion Questions
“How to Raise a Pimp” by Darryl L. Fortson, M.D.
1. In one sentence, paraphrase the author’s stated claim.
2. In one sentence, paraphrase the author’s implied claim.
3. According to the author, what are the four things that one must do in order to raise a pimp?
4. Who is the intended audience of this satire?
5. What is the author trying to accomplish with his satire?
6. Did you enjoy this satire? Why?
7. Do you think this satire is effective? Why?
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
11.I Need a tutor who is experienced in teaching Core plus math course 3. Need explanation and practice of question
...
of question from the chapter. If the student shows progress it is very likely that we will need at least weekly tutoring.
The Topic is inequalities and linear programming.
Please find attached the material:
-cmic unit is the chapter they are studying,
- Core linear programming is questions on the chapter.
- U2 Exam. will need help in answering the questions:
Please read the material carefully and tell me how much time is needed to make the best use of this time to explain the and go over the examples.
How long it takes to have the student review her work with you.
View More