Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This problem set will test your knowledge of System I/O, and variable assignment. Your task is to create several different java classes (.java files) that

This problem set will test your knowledge of System I/O, and variable assignment. Your task is to create several different java classes (.java files) that will produce a specific output based on the user input. All input will be given to you either as a command-line argument or typed in from the keyboard.

Below you will find directions for each class you need to create. Please make sure that the class name and java file name match the name specified in the directions below. For example, the code for the problem named "IsSame" should be put in a java file name IsSame.java and that file should have a class named public class IsSame.

Once you have completed writing your code please compress the files into a zip and upload your code to Grader Than. Grader Than will not grade your submission unless all of the necessary files are included in the submission. In the event that you have completed some of the problems but not all, you can make a partial submission, by making an empty class file for the problems you have not completed. An empty class file just has the public class {...}Block within it nothing else. By doing this, Grader then will grade the files that have code and mark you off for the files that are missing code rather than not grading you completely.

IsSame

This program will accept two user inputted values from the console. The values will be words. The program should print "true" if the words are equal and "false" if the words are not equal. The last string that this program should print is "true" or "false", nothing else.

Sum

This program will accept two user inputted values from the console, the user will only type in whole numbers. The program should add the two numbers together then print the sum. The last string that this program should print is the result of the calculation, nothing else.

Replace

This program will accept three user inputted values. The first two user-inputted values are single-character strings. The last user input is a sentence of random words. This program should replace all occurrences of the first inputted character with the second inputted character in the sentence. Finally, it should print the sentence after the characters have been replaced. The last string that this program should print is the sentence with the replaced characters, nothing else.

LessThanOrEqual

This program will accept two user inputted values that are whole numbers. The program should print "true" if the first number is less than or equal to the second number otherwise it should print "false". The last string that this program should print is "true" or "false", nothing else.

ContainsAnyCase

This program will accept two user inputted values that are strings. The first user input will be a single word the second user input will be a sentence of random words. This program should print "true" if the first word is in the sentence of words regardless of the casing. In other words case is ignored when checking if the word is within the sentence. The last string that this program should print is "true" or "false", nothing else.

PairGreaterLesser

This program will accept four user inputted values that are numbers. The first two inputted values make a pair and the third and fourth inputted values make another pair. This program should print "true" if the first number is less than the second number and the third number is less then the fourth number and the sum of the first pair is less than the sum of the second pair, it should print "false" otherwise. The last string that this program should print is "true" or "false", nothing else.

NthCharacter

This program will accept two user inputted values. The first user inputted value is a number and the second user inputted value is a sentence of words. The program should print the character at the index associated with the first value found in the sentence of words. The last string that this program should print is the character at the specific index, nothing else.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database 11g SQL

Authors: Jason Price

1st Edition

0071498508, 978-0071498500

More Books

Students also viewed these Databases questions