Question

The Problem Solver

People Use computers every day to solve problems, so now is your chance to write a program that will do exactly that! Present the user with a list of 10 things that they might want an app to do and write a menu to pick which task they want to do and then perform that task.

For Example:

Welcome to the Problem Solver! What is your problem today?

1) Convert C to F
2) Give Me Directions to the Essar Center from Algoma U
3) How many letter ‘a’s are in this sentence?
4) is this number odd or even?
5) …
6) …
7) …
8) …
9) …
10) ...

Enter Your Choice: 1[ENTER]

Enter your temp in C: 30 [ENTER]

30 C is 86 F

For each problem I would like to use an implementation of one of each of the following:

● an if, else..if, else structure
● the switch statement
● an implementation at least 2 different boolean operators (&&, ||, ^)
● Utilizing random numbers
● a printf
● using substrings
● an implementation of the for loop
● an implementation of the while loop
● breaking /continuing in a loop
● Solving a mathematical equation

Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

import java.util.Scanner;


public class ProblemSolver {

public static void main(String[] args)
{
int choice;
boolean cont = true;
Scanner input = new Scanner(System.in);

while(cont)
{
System.out.println("Welcome to the Problem Solver! What is your problem today?");
System.out.println("1. Count to 100");
System.out.println("2. Convert between meters and feet");
System.out.println("3. Check for the largest of 3 numbers");
System.out.println("4. Get the first name from a full name");
System.out.println("5. How many words in this sentence?");
System.out.println("6. Get your lucky number for the day");
System.out.println("7. Get pi to a 5 digits");
System.out.println("8. Check if a number is 0, negative or positive");
System.out.println("9. Compute powers of 2");
System.out.println("10. Quit the program");
System.out.print("Enter your choice: ");
choice = input.nextInt();

switch(choice)
{
case 1:
for(int i = 0; i < 100; i++)
System.out.println(i);
break;
case 2:
System.out.print("Enter in the number of meters to convert to feet: ");
int meters = input.nextInt();
double feet = meters * 39/12.0;
System.out.printf("%d meters is %.2f feet\n\n", meters, feet);
break;
case 3:...

This is only a preview of the solution. Please use the purchase button to see the entire solution

Related Homework Solutions

Java Program for Elections
Homework Solution
$24.00
Computer Science
Programming
Java
Elections
Votes
President
Obama
Romney
Candidates
Names
Numbers
States
Winners
Statements
Variables
Data Sets
Buffers
Strings
Functions
Calculator in Java
Homework Solution
$50.00
Computer Science
Java
Programming
Calculator
Input
Output
GUI
Tokens
Productions
Windows
Widgets
Layout Flow
Buttons
Syntax
Statements
Variables
Pyramid Using Asterisks in Java
Homework Solution
$30.00
Java
Programming
Codes
Algorithms
Computer Science
Statements
Variables
Loops
Input
Output
Integers
Strings
Asterisks
Symbols
Pyramid
Rows
Odd Numbers
Vector Addition Problems in Java
Homework Solution
$20.00
Computer Science
Vector Addition
Programming
Java
Algorithms
Variables
Statements
Blocks
Performances
Accuracy
Data Sets
Indexes
Threads
Arrays
Arguments
Integers
Gradebook Using Java Programming
Homework Solution
$20.00
Java
Programming
Computer Science
Random Numbers
Scores
Students
Input
Output
Loops
Statements
Conditions
Average Values
Variables
Mathematics
Parking Problem in Java
Homework Solution
$30.00
Java
Programming
Codes
Classes
Computer Science
Parking
OOP
Car Model
License Number
Owner Name
Strings
Integers
Statements
Input
Output
Constructor
Public Methods
Functions
Get help from a qualified tutor
Live Chats