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: A Dictionary with Array and Linked List
Homework Solution
$30.00
Java
Programming
Codes
Algorithms
Arrays
Linked Lists
Dictionary
Constructor
Class
Integers
File Management
Predecessor
Successor
Input
Output
Statements
Variables
Rock, Paper, Scissors Program
Homework Solution
$60.00
Programming
Java
Computer Science
Rock Paper Scissors
Game
MySQL
Tables
Queries
Results
Rounds
Probability
Loops
Conditions
Winning
Losing
User vs Computer
Databases
ArrayList Fraction Objects in Java
Homework Solution
$15.00
Java
Programming
Computer Science
Coding
Arrays
Fractions
Numerator
Denominator
Decimal Values
Sorted List
Algorithms
Loops
Variables
Statements
Conditions
Java Programming: Printing The Pattern
Homework Solution
$10.00
Java
Programming
Computer Science
Loops
Printing
Patterns
Rows
Loops
Statements
Variables
Integers
Strings
Input
Output
Java Problems: Student Details & Fibonacci Series
Homework Solution
$20.00
Java
Programming
OOP
Computer Science
Fibonacci Series
Students
Classes
Instances
Loops
Conditions
Statements
Variables
Integers
Mathematics
Interactive Command-Line Game in Java
Homework Solution
$50.00
Java
Programming
Coding
Game Development
Computer Science
Zork
Colossal Cave Adventure
Command Line
Maps
2D Grid
Win
Lose
Classes
OOP
Methods
Fields
String Values
Integers
Statements
Get help from a qualified tutor
Live Chats