Question: CPSC 1150 Program Design Assignment #3 Total Marks: 15 marks Goals: This assigmnent gives students more experience in: 0 Problem Solving 0 Writing Java programs




CPSC 1150 Program Design Assignment #3 Total Marks: 15 marks Goals: This assigmnent gives students more experience in: 0 Problem Solving 0 Writing Java programs using selections. loops. Characters and Strings Problem Description Create a Java program (StringS-lanipulationjava) that asks the user to enter a sentence (one line of text). The program then displays a menu of options for manipulating the string. Note 0 Use the Scanner nextLine method to read the sentence from the user. 0 The program should be repeated until the user enters 6 to terminate. o The program should be implemented using user-defined methods (one for each of the string manipulation options) which we will go over during next week. Meanwhile, I want you to figure out the logic and try to make this work without using methods. By the end of next week, you should be able to add the logic into the methods and complete the tasks. The following is a sample screenshot of the output: Please enter a sentence: Java is an Object-Oriented programming language (2023). please enter: 1: To display the number of words in the sentence 2: To display the number of vowel characters in the sentence 3: To display the longest word 4: To display the word with the most vowels 5: To enter a new sentence 6: To terminate the program The number of words in the "Java is an Object-Oriented programming language (2023) . " is 7 please enter: 1: To display the number of words in the sentence 2: To display the number of vowel characters in the sentence 3: To display the longest word 4: To display the word with the most vowels 5: To enter a new sentence 6: To terminate the program 2 There are: e's 3 1's B o's 1 u's in "Java is an Object-Oriented programming language (2023)." please enter: 1: To display the number of words in the sentence : To display the number of vowel characters in the sentence 3: To display the longest word 4: To display the word with the most vowels 5: To enter a new sentence 6: To terminate the program 3 The longest word in "Java is an Object-Oriented programming language (2023). " is Object-Oriented please enter: 1: To display the number of words in the sentence 2: To display the number of vowel characters in the sentence 3: To display the longest word 4: To display the word with the most vowels 5: To enter a new sentence To terminate the program The word with the most vowels in "Java is an Object-Oriented programming language (2023) . " is object-Oriented please enter: 1: To display the number of words in the sentence 2: To display the number of vowel characters in the sentence 3: To display the longest word : To display the word with the most vowels 5: To enter a new sentence 8: To terminate the program 5 Please enter a new sentence. Learning Java is easy and fun, no matter what background you have. please enter: 1: To display the number of words in the sentence To display the number of vowel characters in the sentence 3: To display the longest word 4: To display the word with the most vowels S: To enter a new sentence 6: To terminate the program The number of words in the "Learning Jave is easy and fun, no matter what background you have. " is 12 please enter: 1: To display the number of words in the sentence 2: To display the number of vowel characters in the sentence 3: To display the longest word 4: To display the word with the most vowels 5: To enter a new sentence 6: To terminate the program 4 The word with the most vowels in "Learning Java is easy and fun, no matter what background you have." is Learningplease enter: 1: To display the number of words in the sentence 2: To display the number of vowel characters in the sentence 3: To display the longest word : To display the word with the most vowels : To enter a new sentence 6: To terminate the program Please enter a new sentence. Gympy 's cry please enter: 1: To display the number of words in the sentence 2: To display the number of vowel characters in the sentence 3: To display the longest word To display the word with the most vowels 5: To enter a new sentence 6: To terminate the program 2 There are: B a's Bi's BU'S in "Gympy's cry" please enter: 1: To display the number of words in the sentence 2: To display the number of vowel characters in the sentence 3: To display the longest word 4: To display the word with the most vowels 5: To enter a new sentence 6: To terminate the program 3 The longest word in "Gympy's cry" is Gympy's The longest word in "Gympy's cry" is Gympy's please enter: 1: To display the number of words in the sentence 2: To display the number of vowel characters in the sentence 3: To display the longest word 4: To display the word with the most vowels 5: To enter a new sentence 6: To terminate the program 4 The word with the most vowels in "dyspy's cry" is ". there is no word with vowels." please enter; 1: To display the number of words in the sentence 2: To display the number of vowel characters in the sentence 3: To display the longest word 4: To display the word with the most vowels 5: To enter a new sentence 6: To terminate the program The program termiatesMarking Scheme Make a folder named A3 yourname StudentID containing your source code file, zip the folder and submit the zipped file to BrightSpace. [3 marks] Presentation and Style: Readability, descriptive identifier, indentation, bracket placement, internal documentation (comments), use of appropriate constants [12 marks] Correctness: Program works without bugs and displays appropriate output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
