a.
Explanation of Solution
Program:
File name: “CarCareChoice.java”
//Import necessary header files
import javax.swing.*;
//Define a class named CarCareChoice
public class CarCareChoice
{
//Define a main method
public static void main (String[] args)
{
//Declare a Boolean variable and initialize the value
boolean isMatch = false;
//Declare a list of available services
String[] items = { "oil change", "tire rotation",
"battery check", "brake inspection"};
//Declare an array of values
int[] prices = {25, 22, 15, 5};
//Declare the variables
int x;
int matchIndex = 0;
//Prompt the user to enter a selection
String menu = "Enter selection:";
for(x = 0; x < items.length; ++x)
menu += "\n " + items[x];
//Show input dialog box
String selection = JOptionPane...
b.
Explanation of Solution
Program:
File name: “CarCareChoice2.java”
//Import necessary header files
import javax.swing.*;
//Define a class named CarCareChoice2
public class CarCareChoice2
{
//Define a main method
public static void main (String[] args)
{
//Declare a Boolean variable and initialize the value
boolean isMatch = false;
//Declare a list of available services
String[] items = { "oil change", "tire rotation",
"battery check", "brake inspection"};
//Declare an array of values
int[] prices = {25, 22, 15, 5};
//Declare the variables
int x;
int matchIndex = 0;
//Prompt the user to enter a selection
String menu = "Enter selection:";
for(x = 0; x < items.length; ++x)
menu += "\n " + items[x];
//Show input dialog box
String selection = JOptionPane...
Trending nowThis is a popular solution!
- Write a FancyCar class to support basic operations such as drive, add gas, honk horn, and start engine. FancyCar.java is provided with method stubs. Follow each step to gradually complete all methods. Note: This program is designed for incremental development. Complete each step and submit for grading before starting the next step. Only a portion of tests pass after each step but confirm progress. The main() method includes basic method calls. Add statements in main() as methods are completed to support development mode testing. Step 0. Declare private fields for miles driven as shown on the odometer (int), gallons of gas in tank (double), miles per gallon or MPG (double), driving capacity (double), and car model (String). Note the provided final variable indicates the gas tank capacity of 14.0 gallons. Step 1 (2 pts). 1) Complete the default constructor by initializing the odometer to five miles, tank is full of gas, miles per gallon is 24.0, and the model is "Old Clunker". 2)…arrow_forwardFind the error: daily_sales = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] days_of_week = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] for i in range(7): daily_sales[i] = float(input('Enter the sales for ' \ + day_of_week[i] + ': ')arrow_forwardFind the error: daily_sales = [0.0, 0,0, 0.0, 0.0, 0.0, 0.0, 0.0] days_of_week = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] for i in range(7): daily_sales[i] = float(input('Enter the sales for ' \ + days_of_week[i] + ': ')arrow_forward
- Find the error: daily_sales = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] days_of_week = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] for i in range(6): daily_sales[i] = float(input('Enter the sales for ' \ + days_of_week[i] + ': '))arrow_forwardWhat are the steps you will follow in order to check the database and fix any problems with it and normalize it? Give two references with your answer.arrow_forwardWhat are the steps you will follow in order to check the database and fix any problems with it? Have in mind that you SHOULD normalize it as well. Consider that the database offline is not allowed since people are connected to it and personal data might be bridged and not secured. Provide three refernces with you answer.arrow_forward
- Should software manufacturers should be tolerant of the practice of software piracy in third-world countries to allow these countries an opportunity to move more quickly into the information age? Why or why not?arrow_forwardI would like to know about the features of Advanced Threat Protection (ATP), AMD-V, and domain name space (DNS).arrow_forwardPlease show the code for the Tikz figurearrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTEBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning