a.
Explanation of Solution
Program:
File name: “RetirementGoal.java”
//Import necessary header files
import java.util.Scanner;
//Define a class named RetirementGoal
public class RetirementGoal
{
//Define main method
public static void main (String[] args)
{
//Create an object for the Scanner class
Scanner input = new Scanner(System.in);
//Declare the variables
int years;
int saveAmount;
int total;
/*Prompt the user to enter the number of years the user
has until retirement */
System.out.print("How many years until retirement? >> ");
years = input.nextInt();
/*While condition if the user enters 0 or a negative number*/
while(years <= 0)
{
//Print the error message
System.out.println("Years cannot be 0 or negative");
//Reprompt the user to make a valid entry
System...
b.
Explanation of Solution
Program:
File name: “RetirementGoal2.java”
//Import necessary header files
import java.util.Scanner;
//Define a class named RetirementGoal2
public class RetirementGoal2
{
//Define main method
public static void main (String[] args)
{
//Create an object for the Scanner class
Scanner input = new Scanner(System.in);
//Declare the variables
int years;
int saveAmount;
int total;
final double RATE = 0.04;
/*Prompt the user to enter the number of years the user
has until retirement */
System.out.print("How many years until retirement? >> ");
years = input.nextInt();
/*While condition if the user enters 0 or a negative number*/
while(years <= 0)
{
//Print the error message
System.out.println("Years cannot be 0 or negative");
//Reprompt the user to make a valid entry
System.out.print("Please renter years >> ");
years = input.nextInt();
}
/*Prompt the user to enter the amount of money the user can save annually*/
System.out.print("How much can you save annually? >> ");
saveAmount = input.nextInt();
/*While condition if the user enters 0 or a negative number*/
while(saveAmount <= 0)
{
//Print the error message
System...
Trending nowThis is a popular solution!
- Translate the following VM commands to Assembly instructions: □ push constant 1 □ push constant 5arrow_forwardSuppose the state of the argument and local memory segments are as follows: argument local stack 0 0 9 sp-> 256 1 257 1 14 2 258 259 Now consider the following VM code: 1 push constant 2 pop local @ 3 push constant 15 4 pop local 1 5 push local 1 6 push argument 1 7 gt 8 pop local 2 9 push local 0 10 push argument 0 11 add 12 pop local 0 13 push local 1 14 push local 1 15 push constant 1 16 sub 17 add 18 pop local 1 What will be the value of local 1 after the VM code has executed?arrow_forwardSuppose the state of the RAM is as follows and the adjacent assembly code will execute: RAM 0 3 1 2 2 0 فيا 3 6 456 5 1 4 1234567 $1 A = M A = M A = M D = M @4 M = D What will be the value of the RAM[4] following the assembly code execution?arrow_forward
- Two industries that use decision trees extensively are lenders (banks, mortgage companies, etc.) and insurance. Discuss how a decision tree is used to solve a business problem.arrow_forwardand some More lab 9 For the last lab of the term, I want you to create a practical application for your database, in which you modify it in some way, for instance, taking a new order. Since the emphasis is on the database connectivity, neither a GUI nor a web application is required. In fact, a GUI would require x2go, which I don't have at home and you probably don't either. A web interface would need to be on osiris, I could figure out some way to try it out, I guess. There are also numerous security concerns. The applications should be easy for someone like a store employee or on-line customer to use. The most common operations, such as adding a customer or renting a tool, should be implemented. These Part 1 instructions now include how to use postgresql in C as well as Java and python. The important issue of transactions and commit status is addressed here. Some previous notes about web applications, and the PHP language [Previously I wrote] Now write one more program, that updates…arrow_forwardc# app formarrow_forward
- (a) Giving C and k constants, determine the big-theta for the function: f(x) = 9x4 − x³ +5x+2+(-13 + 9x³ - 7x)log(8x6 + 5x³ + 9x² + 11x + 3) -arrow_forwardFollow the instructionsarrow_forwardPlease help me adjust the X-axis on my graphs in Excel spreadsheet. Range numbers are from 200 to 500 but is graphed 0 to 300. Link:https://mnscu-my.sharepoint.com/:x:/g/personal/vi2163ss_go_minnstate_edu/EdVWDTGQ2hNJuGHiHPukjuIB9DBRlyoUC8Fuqlxj2E_CQg Thank you!arrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT