Answer: data
Explanation:
What steps should a user take to create a secondary address book?
Open the Backstage view and Account Settings.
Open the Backstage view, and click People options.
Open the People view, and click New Address Book.
Open the People view, click Folder tab, and click New Folder.
Answer:
It's A
Explanation:
correct on edg
Answer:
A is correct on edg
Explanation:
HEY DO U LIKE TRAINS!
Answer:
yes
Explanation:
yes
Describe yourself as a programming object and give at least 5 properties and 5 methods that you think you are equipped with.
Answer:
The answer to this question is given below in the explanation section.
Explanation:
I consider myself a programming object, then the following are my properties and methods.
Properties (represents the features)
name.height.weight.skin color.eye color,hair styleMethods (represents the behavior)
Walk.Eat,ListenSpeakDrinkTo close a window in Windows 10, you can _____. Select all that apply. A. right-click its button on the taskbar, then click Close window B. click the Close button in the upper-right corner of the window C. click the Close button in the window's thumbnail on the taskbar D. click the Start button and click the program name or icon
Answer:
A, B and C
Explanation:
A, B and C
(The following is unrelated to the answer just to fill the letters criteria)
For closing the window in Windows 10, the following steps should be considered:
The right-click should be done on the taskbar and then click on the close window.On the upper-right corner of the window, click on the close button.On the window thumbnail that shows on the taskbar, click on the close button.Now if we click on the start button and then click the program icon so the particular program opens instead of closing it.
Therefore the above steps are considered for closing out the window in windows 10.
Learn more about windows 10 here: /brainly.com/question/19652025
Use JavaWrite a program that will simulate a change machine found at cash registers. Input the amount due and amount paid from the keyboard.Tell the user how much change is owed and number of quarters, dimes, nickels, and pennies in change a customer would receive.Pay special attention to roundoff error. Your program should use division and modular division. No if’s or loops may be used. You may assume all change will be a positive number with no more than two decimal places. If more than $1.00 is owed, the full value should be included in the number of quarters returned. For example, $2.50 should be returned as 10 quarters.Hint: Modular division is a great way to find the remainder of a division. Think about how you can use this to calculate the change that is left over after some coins are given.Sample Run:Please Enter the Cost of the Item:4.57Please Enter the Amount Paid:5.00Change Owed: 0.43Quarters: 1Dimes: 1Nickels: 1Pennies: 3
Answer:
Here is the JAVA program:
import java.util.Scanner; //to accept input from user
public class Main { // class name
public static void main(String [] args) { // start of main method
Scanner input = new Scanner(System.in); // creates Scanner class object to take input from user
System.out.println("Please Enter the Cost of the Item: "); // prompts user to enter the cost of item
double itemCost = input.nextDouble(); //scans and reads the input value of item cost
System.out.println("Please Enter the Amount Paid: "); // prompts user to enter the amount paid
double amount = input.nextDouble(); //scans and reads the value of amount from user
int change = (int)(amount * 100 - itemCost * 100); //compute the remaining amount i.e. change
System.out.println("Change Owed: " + change / 100.0); // displays the owed change
int quarters = change / 25; // computes the value for quarters
change = change % 25; // compute the quarters remaining
int dimes = change / 10; // computes dimes
change = change % 10; // computes dimes remaining
int nickels = change / 5; // computes nickels
change = change % 5; // compute nickels remaining
int pennies = change; // computes pennies
System.out.println("Quarters: " + quarters); // displays computed value of quarters
System.out.println("Dimes: " + dimes); // displays value of dimes
System.out.println("Nickels: " + nickels); // displays value of nickels
System.out.println("Pennies: " + pennies); }} //displays value of pennies
Explanation:
I will explain the program with an examples.
Suppose the user enters 4.57 as cost of the item and 5.00 as amount paid. Then the program works as follows:
Change is computed as
change = (int)(amount * 100 - itemCost * 100);
This becomes;
change = (int)(5.00 * 100 - 4.57 * 100)
= 500 - 457
change = 43
Now the change owed is computed as:
change / 100.0 = 43/100.0 = 0.43
Hence change owed = 0.43
Next quarters are computed as:
quarters = change / 25;
This becomes:
quarters = 43/25
quarters = 1
Now the remaining is computed as:
change = change % 25;
This becomes:
change = 43 % 25;
change = 18
Next the dimes are computed from remaining value of change as:
dimes = change / 10;
dimes = 18 / 10
dimes = 1
Now the remaining is computed as:
change = change % 10;
This becomes:
change = 18 % 10
change = 8
Next the nickels are computed from remaining value of change as:
nickels = change / 5;
nickels = 8 / 5
nickels = 1
Now the remaining is computed as:
change = change % 5;
This becomes:
change = 8 % 5
change = 3
At last the pennies are computed as:
pennies = change;
pennies = 3
So the output of the entire program is:
Change Owed: 0.43 Quarters: 1 Dimes: 1 Nickels: 1 Pennies: 3
The screenshot of the output is attached.
Which of the following statements best
describes a high level language?
A. The syntax is all 1's and O's.
B. The syntax is English-like.
C. All high level languages look the same.
D. High level languages are the most difficult to understand.
Answer
b
Explanation:
Common lossless compressed audio file formats include
WMA and JIFF
WAV and AU
MP3 and MP4a
FLAC and ALAC
Answer:
The answer to this question is given below in the explanation section. The forth one (FLAC and ALAC) is the correct option.
Explanation:
Common lossless compressed audio file formats include
WMA and JIFF WAV and AU MP3 and MP4a FLAC and ALACLossless compression formats include the common FLAC, WavPack, Monkey's Audio, ALAC (Apple Lossless). Other options are not common lossless compressed audio formats.
Answer:d d
Explanation:
As a producer you are willing to supply the most goods at the highest price this is because the highest price earns you the
Answer:
most money
Explanation:
common sense
CNT Books has expanded considerably since you got the network up and running three years
ago. It now occupies an entire floor in the building, and its LAN has grown to include several
servers and more than 60 workstations.
CNT Books has recently purchased another book company and needs more space and
computers. Expansion plans include leasing another floor four stories above the current offices
in the same building and adding 35 workstations and at least one more server immediately,
with additional equipment purchases expected. [15 marks]
i. What type of network is called for—LAN, WAN, MAN, or internetwork?
Answer:
The answer to this question is given below in the explanation section
Explanation:
CNT Books has expanded considerably since you got the network up and running three years ago. It now occupies an entire floor in the building, and its LAN has grown to include several servers and more than 60 workstations.
CNT Books has recently purchased another book company and needs more space and computers. Expansion plans include leasing another floor four stories above the current offices in the same building and adding 35 workstations and at least one more server immediately, with additional equipment purchases expected.
The type of networking CNT Book will use is WAN.
LAN
A local area network (LAN) is a group of computers and peripheral devices that share a common communications line or wireless link to a server within a distinct geographic area. A local area network may serve as few as two or three users in a home-office or several hundred users in a corporation's central office
WAN
A wide area network (WAN) is a geographically distributed private telecommunications network that interconnects multiple local area networks (LANs). A LAN is a group of computers and network devices which are all connected to each other, typically from within a short relative geographical distance.
MAN
A metropolitan area network is a computer network that interconnects users with computer resources in a geographic region of the size of a metropolitan area.
internetworking
Internetworking is the process or technique of connecting different networks by using intermediary devices such as routers or gateway devices. Internetworking ensures data communication among networks owned and operated by different entities using a common data communication and the Internet Routing Protocol. internetworking is not a network type but it is a process or technique of connecting different networks by using intermediary devices.
Is Zero (Sam Fisher, Rainbow Six Siege version of course) overpowered because of the fact he has a gun that does 45 damage at a fire rate of 800rpm
Answer:
Yes
Explanation:
I see his damage and rpm as unfair because of the fact that he can deal over 36,000 damage in one minute.
Given four values representing counts of quarters, dimes, nickels and pennies, output the total amount as dollars and cents. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: System.out.printf("Amount: $%.2f\n", dollars); Ex: If the input is: 4 3 2 1 where 4 is the number of quarters, 3 is the number of dimes, 2 is the number of nickels, and 1 is the number of pennies, the output is: Amount: $1.41 For simplicity, assume input is non-negative.
LAB ACTIVITY 2.32.1: LAB: Convert to dollars 0/10 LabProgram.java Load default template. 1 import java.util.Scanner; 2 3 public class LabProgram 4 public static void main(String[] args) { 5 Scanner scnr = new Scanner(System.in); 6 7 /* Type your code here. */|| 8 9) Develop mode Submit mode Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box Enter program input (optional) If your code requires input values, provide them here. Run program Input (from above) 1 LabProgram.java (Your program) Output (shown below) Program output displayed here
Answer:
Replace /* Type your code here. */ with the following lines of code
int quarter =scnr.nextInt();
int dime = scnr.nextInt();
int nickel = scnr.nextInt();
int penny = scnr.nextInt();
double dollars = quarter * 0.25 + dime * 0.1 + nickel * 0.05 + penny * 0.01;
System.out.printf("Amount: $%.2f\n", dollars);
System.out.print((dollars * 100)+" cents");
Explanation:
The next four lines declare the given currencies as integer
int quarter =scnr.nextInt();
int dime = scnr.nextInt();
int nickel = scnr.nextInt();
int penny = scnr.nextInt();
This line calculates the amount in dollars
double dollars = quarter * 0.25 + dime * 0.1 + nickel * 0.05 + penny * 0.01;
The next two lines print the amount in dollars and cents respectively
System.out.printf("Amount: $%.2f\n", dollars);
System.out.print((dollars * 100)+" cents");
Given four values representing counts of quarters, dimes, nickels and pennies, the total amount in dollars and cent can be represented as follows;
#1 quarters = 0.25 dollars
#1 dime = 0.1 dollar.
#1 nickel = 0.05 dollars
#1 penny = 0.01 dollars
#quarters, dimes, nickels and pennies,
x = input("write your input here: ")
for i in x:
quarters = 0.25*float(x[0])
dime = 0.1*float(x[1])
nickel = 0.05*float(x[2])
penny = 0.01*float(x[3])
sum1 = quarters + dime + nickel + penny
print(round(sum1, 2))
Code explanation:The commented section of the code is just the conversion rate of quarters, dime, nickel and penny to dollars.
Variable x is used to store the user's input.Then, we loop through the users inputThen multiply each looped value by it conversion rate to dollars.Finally, we sum the values and print the sum rounded to 2 decimal places as required.learn more on python code here: https://brainly.com/question/24556911?referrer=searchResults
essay regarding a magic cell phone that turns into robot
It should be noted that when writing an essay, it's important to effectively present the information to the readers.
Writing an essay.When writing the essay, the following steps are required:Create an essay outline.It's important to also develop a thesis statement.Introduce the topic.Then, write the body of the message The conclusion should be presented.It should be noted that when writing the essay, it's also important to integrate the evidence clearly and ensure that the grammar used is correct.
Learn more about essays on:
https://brainly.com/question/25607827
The graphical user interface (GUI) was pioneered in the mid-1970s by researchers at:
A) Apple Computer
B) Microsoft
C) Xerox
D) IBM
Answer:
its C actually
Explanation:
C) Xerox plus i had a quiz
Answer:
xerox
Explanation:
What weight pencil is recommended for darkening lines and for lettering? *
Answer: darkened
Explanation: darkened
Answer:
While the softer B pencils are generally considered the best for shading, there's no reason to discount the harder H pencils. The HB and H are good choices for fine, light, even shading. However, they too have drawbacks. Pencil grades from HB through H, 2H to 5H get progressively harder and are easier to keep sharp.
who could be involved in the murder of Mr Douglas
Answer:
Freedy Thopson
Explanation:
asking questions is super in this education life
A user is asked to type a caption for a photo in a web form's text field. If the caption didn't end with a punctuation mark (. ! ?), a period should automatically be added. A common error is to end with a comma, which should be replaced by a period. Another common error is to end with two periods, which should be changed to one period (however, ending with three periods (or more) indicates elipses so should be kept as is). The corrected caption is output. If the input is "I like pie", the output is "I like pie." If the input is "I like pie!", the output remains "I like pie!" If the input is "Coming soon…", the output remains "Coming soon…"
Answer:
Here is the c++ program:
#include <iostream> //to use input output functions
using namespace std; //to identify objects cin cout
int main() { //start of main function
string caption; //stores the caption
int last_index; //stores the index position of the last character of caption
char last_character; //stores the last character of the caption
cout<<"Please type a caption: "; //prompts user to enter a caption
getline(cin, caption); //reads the complete line of caption from user
last_index = caption.size() - 1; //sets the last_index to the last character of caption
last_character = caption.at(last_index); //sets the last_character to the last character positioned by last_index
if ((last_character == '!') || (last_character == '?')) {} /* checks if the last character of the caption is either ! or ? and if this statement evaluate to true then this does not require any action */
else if (last_character == ',') { //checks if the last character of the caption is a comma
caption.at(last_index) = '.'; } //if the else if condition is true then replace that comma with a period .
else if (last_character != '.') { //checks if the caption does not end with ! ? , .
caption.push_back('.');} //append period to the caption . if above if else condition is true
else if ((last_index > 0) && (last_character == '.') && (caption.at(last_index - 1) == '.')) { //checks if the caption has two periods .
if ((last_index > 1) && (caption.at(last_index - 2) == '.')) {} //checks if the caption has three periods and does nothing if this is true
else { //if caption has two periods
caption.pop_back();}} //removes one period if caption has two periods .
cout << caption << endl;} //displays the caption
Explanation:
I will explain the above program with an example
Lets say user input the caption: I like pie
So
caption = " I like pie"
The first if condition if ((last_character == '!') || (last_character == '?')) evaluate to false because the last character of the caption is not an exclamation mark of a question mark. So the program moves to the next else if statement:
else if (last_character == ',') This statement is also false because the last character of the caption is not a comma. So the program moves to the next else if part.
else if (last_character != '.')
Now this statement evaluate to true because the last character of the caption is not a period . sign. So this part is executed. It has a statement:
caption.push_back('.');
Now this statement uses push_back() method which adds new character i.e. period '.' at the end of the caption string, increasing its length by one.
So the output of the program is:
I like pie.
If the caption = " I like pie!" then this if ((last_character == '!') || (last_character == '?')) condition executes and since it does nothing {} so the caption remains as it is and the output is:
I like pie!
If the caption = "Coming soon…" then this else if ((last_index > 0) && (last_character == '.') && (caption.at(last_index - 1) == '.')) condition executes which checks if the caption has two period. When this condition evaluates to true then the statement inside this else if condition executes which is: if ((last_index > 1) && (caption.at(last_index - 2) == '.')) and this checks if the caption has three periods. Yes the caption has three periods so it does nothing and the caption remains as it is and the output is:
Coming soon…
However if the caption is Coming soon.. with two periods then the else part inside else if ((last_index > 0) && (last_character == '.') && (caption.at(last_index - 1) == '.')) condition executes which is: caption.pop_back(); and this removes one period from the caption and the output is:
Coming soon.
The screenshot of the program and its output is attached.
how would you share information and communicate news and events
Answer:
You could use Print things (mail, books, etc.) or Online things (internet, social media, etc.)
Hope this helps :)
Write both an iterative and recursive solution for the factorial
problem.
Answer:
Explanation:
Recursive:
C++ program to find factorial of given number
#include <iostream>
using namespace std;
unsigned int factorial(unsigned int n)
{
if (n == 0)
return 1;
return n * factorial(n - 1);
}
// Driver code
int main()
{
int num = 5;
cout << "Factorial of "
<< num << " is " << factorial(num) << endl;
return 0;
Iterative:
// C++ program for factorial of a number
#include <iostream>
using namespace std;
unsigned int factorial(unsigned int n)
{
int res = 1, i;
for (i = 2; i <= n; i++)
res *= i;
return res;
}
// Driver code
int main()
{
int num = 5;
cout << "Factorial of "
<< num << " is "
<< factorial(num) << endl;
return 0;
}
Alan wants to buy camera support equipment that would provide mechanical support to his camera and which could also store extra battery power. Which piece of camera equipment should Alan buy for this purpose?
Alan can use a ____, which would provide mechanical assistance and store extra batteries for his camera.
Answer:
Could it be tripod?
Explanation:
If you did this question do you remember what the answer was?
Answer:
motorized grip
Explanation:
Read each description below, and then choose the correct term that matches the description from the drop-down menus.
wireless technology that lets you identify and track objects
medical uses of RFID
a low-power radio wave used for short distances
computing device used with Bluetooth Read each description below, and then choose the correct term that matches the description from the drop-down menus.
wireless technology that lets you identify and track objects
medical uses of RFID
a low-power radio wave used for short distances
computing device used with Bluetooth
Answer:
wireless technology that lets you identify and track objects (radio frequency identification)
medical uses of RFID (patient identification)
a low-power radio wave used for short distances (bluetooth)
computing device used with Bluetooth hands-free microphone in car
Explanation:
sorry if late :/
Answer:
Explanation:
edg 2021
Let's play Silly Sentences!
Enter a name: Grace
Enter an adjective: stinky
Enter an adjective: blue
Enter an adverb: quietly
Enter a food: soup
Enter another food: bananas
Enter a noun: button
Enter a place: Paris
Enter a verb: jump
Grace was planning a dream vacation to Paris.
Grace was especially looking forward to trying the local
cuisine, including stinky soup and bananas.
Grace will have to practice the language quietly to
make it easier to jump with people.
Grace has a long list of sights to see, including the
button museum and the blue park.
Answer:
Grace sat quietly in a stinky stadium with her blue jacket
Grace jumped on a plane to Paris.
Grace ate bananas, apples, and guavas quietly while she listened to the news.
Grace is the name of a major character in my favorite novel
Grace was looking so beautiful as she walked to the podium majestically.
Grace looked on angrily at the blue-faced policeman who blocked her way.
In the insert table of figures dialog box which drop down menu do you use to choose what information is displayed in the table
Answer:
caption label
Explanation:
What is an instance of a computer program that is being executed?
1. Processing
2. Storage
3. Input
4. App
Lee has finished formatting his table. He wants to import an Excel table to show the density and mean temperature data of the terrestrial planets.
Which tab should he navigate to?
Which command group should he use?
Which option should he click?
Which button should he click first in the dialog box that opens?
Answer:
1. Insert
2. Text
3. Object
4. Create from file
Explanation:
On edg
After formatting his Excel table, Lee should navigate to the Insert tab and use the text command group.
What is an Excel table?An Excel table can be defined as a rectangular range of data in a spreadsheet document, which comprises cells that are typically arranged by using rows and columns.
In this scenario, Lee should navigate to the Insert tab and use the text command group after formatting his Excel table.
Also, an option which he click is object while clicking on the "create from file" button in the dialog box that opens.
Read more on Excel table here: https://brainly.com/question/13776450
#SPJ2
2
Select the correct answer from each drop-down menu.
Different web browsers perform similar
functions, which are presented in the form of?
A. Text labels
B. Webpages
C. Buttons and menus
Answer:
The answer to this question is given below in the explanation section.
Explanation:
The correct answer to this question is B.
Because different browsers perform similar functions that are presented in the form of webpages. If you want to run the webpage in chrome, it will run similarly as you run it in internet explorer or in firefox.
However, other options such as text labels and buttons and menus are not the browser functions because these are the elements of the webpages.
so the correct answer to this question is webpages.
Please Help Me
What kinds of solutions are proposed for different IT issues, and what are their advantages and disadvantages?
Answer:
There are three basic forms of business ownership: sole proprietorship, partnership and corporation. Each of these forms of business organization has advantages and disadvantages in such areas as setting up the company, paying taxes and assessing liability for business debts
• Open your Netbeans IDE and answer the following question
• Create a folder on the desktop. Rename it with your student name and student number
• Save your work in the folder you created.
At a certain store they sell blank CDs with the following discounts:
* 10% for 120 or more
* 5% for 50 or more
* 1% for 15 or more
* no discount for 14 or less
Write a program that asks for a number of discs bought and outputs the correct discount. Use either a switch statement or if..elseif.. ladder statements. Assuming that each blank disk costs N$3.50. The program should then calculate the total amount paid by the buyer for the discs bought.
Answer:
public static void main(String[] args)
{
int cdCount;
double cdCountAfterDiscount;
DecimalFormat df = new DecimalFormat("$##.##"); // Create a Decimal Formatter for price after discount
System.out.println("Enter the amount of CD's bought");
Scanner cdInput = new Scanner(System.in); // Create a Scanner object
cdCount = Integer.parseInt(cdInput.nextLine()); // Read user input
System.out.println("CD Count is: " + cdCount); // Output user input
if(cdCount <= 14 )
{
System.out.println("There is no discount");
System.out.println("The final price is " + cdCount*3.5);
}
if(cdCount >= 15 && cdCount<=50)
{
System.out.println("You have a 1% discount.");
cdCountAfterDiscount = (cdCount *3.5)-(3.5*.01);
System.out.println("The final price is " + df.format(cdCountAfterDiscount));
}
if(cdCount >= 51 && cdCount<120)
{
System.out.println("You have a 5% discount.");
cdCountAfterDiscount = (cdCount *3.5)-(3.5*.05);
System.out.println("The final price is " + df.format(cdCountAfterDiscount));
}
if(cdCount >= 120)
{
System.out.println("You have a 10% discount.");
cdCountAfterDiscount = (cdCount *3.5)-(3.5*.1);
System.out.println("The final price is " + df.format(cdCountAfterDiscount));
}
}
In programming, what is a floating-point number?
A number with a decimal, Option A
Which option in the Caption dialog box configures whether the caption appears above or below the image?
Label
New Label
Position
Numbering
Answer:
label
jhguy
iiy767
jiuuyuihlk
njhuiyyhjjgiug
gugkjbkjhg
Answer:
Position
Explanation:
This needs to be written in Java.
Create an Automobile class for a dealership. Include fields for an ID number, make, model, color, year, vin number, miles per gallon, and speed. Include get and set methods for each field. Do not allow the ID to be negative or more than 9999; if it is, set the ID to 0. Do not allow the year to be earlier than 2000 or later than 2017; if it is, set the year to 0. Do not allow the miles per gallon to be less than 10 or more than 60; if it is, set the miles per gallon to 0. Car speed should be initialized as 0. Include a constructor that accepts arguments for each field value and uses the set methods to assign the values. Also write two methods, Accelerate () and Brake (). Whenever Accelerate () is called, increase the speed by 5, and whenever Brake () is called, decrease the speed by 5. To allow users to specify the speed to increase (or decrease), create two overloading methods for Accelerate () and Brake () that accept a single parameter specifying the increasing (or decreasing) speed. Write an application that declares several Automobile objects and demonstrates that all the methods work correctly. Save the files as Automobile.java and TestAutomobiles.java
Answer:
Here is Automobile.java
class Automobile { //class name
private int ID, year, milesPerGallon, speed = 0; // private member variables of Automobile of int type
private String model, vinNo, make, color; // private member variables of Automobile of String type
public void setID(int ID){ //mutator method to set ID
if (ID >= 0 && ID <= 9999) // checks ID should not be negative or more than 9999
this.ID = ID;
else this.ID = 0; } //if ID is negative or greater than 9999 then set ID to 0
public void setModel(String model){ // mutator method to set model
this.model = model; }
public void setYear(int year){// mutator method to set year
if (year >= 2000 && year <= 2017) //checks that year should not be earlier than 2000 or later than 2017
this.ID = ID;
else this.year = 0; } //if year is less than 2000 or greater than 2017 then set year to 0
public void setVinNo(String vinNo){ //mutator method to set vin number
this.vinNo = vinNo; }
public void setMilesPerGalon(int milesPerGallon){ //mutator method to set miles per gallon
if (milesPerGallon >= 10 && year <= 60) //checks that miles per gallon should not be less than 10 or more than 60
this.milesPerGallon = milesPerGallon;
else this.milesPerGallon = 0; } //if it is more than 60 or less than 10 then set miles per gallon to 0
public void setSpeed(int speed){ //mutator method to set speed
this.speed = speed; }
public void setMake(String make){ //mutator method to set make
this.make = make; }
public void setColor(String color){ //mutator method to set color
this.color = color; }
public int getID() //accessor method to get or access ID
{return ID;} //returns the current ID
public String getModel() //accessor method to get or access model
{return model;} //returns the current model
public int getYear()// accessor method to get or access year
{return year;} //returns the current year
public String getVinNo() // accessor method to get or access vin number
{return vinNo;} //returns the current vin number
public int getMilesPerGallon() //accessor method to get or access miles per gallon
{return milesPerGallon;} //returns the current miles per gallon
public int getSpeed() //accessor method to get or access speed
{return speed;} //returns the current speed
public String getMake() //accessor method to get or access make
{return make;} //returns the current make
public String getColor() //accessor method to get or access color
{return color;} //returns the current color
public int Accelerate() { //method that increase speed by 5
setSpeed(speed + 5); //calls set speed to add 5 to the speed field
return speed; } //returns the speed after increasing 5
public int Brake() { //method that decreases speed by 5
setSpeed(speed - 5);//calls set speed to subtract 5 from the speed field
return speed; } //returns the speed after decreasing 5
public int Accelerate(int spd) { //overloading methods for Accelerate()that accepts a single parameter spd
setSpeed(speed + spd); //increases speed up to specified value of spd
return speed; }
public int Brake(int spd) { //overloading methods for Brake()that accepts a single parameter spd
setSpeed(speed - spd); //decreases speed up to specified value of spd
return speed; }
public Automobile(int ID, String make, String model, int year, String vinNo, int milesPerGallon, int speed, String color){ //constructor that accepts arguments for each field value and uses the set methods to assign the values
setID(ID);
setModel(model);
setYear(year);
setVinNo(vinNo);
setMilesPerGalon(milesPerGallon);
setSpeed(speed);
setMake(make);
setColor(color); } }
Explanation:
Here is TestAutomobiles.java
public class TestAutomobiles { //class name
public static void main(String args[]) { //start of main method
Automobile auto = new Automobile(123, "ABC", "XYZ", 2010, "MMM", 30, 150, "White"); //creates an object of Automobile class and calls its constructor passing the values for each of the fields
System.out.println("Initial Speed: " + auto.getSpeed()); //calls getSpeed method to get the current speed using object auto. The current speed is 150
System.out.println("Speed after applying acceleration: " + auto.Accelerate()); //calls Accelerate() method to increase the current speed to 5
System.out.println("Speed after applying brake: " + auto.Brake()); //calls Brake() method to decrease the current speed to 5
System.out.println("Speed after applying acceleration: " + auto.Accelerate(180)); //calls overloading Accelerate() method to increase the current speed to 180
System.out.println("Speed after applying brake: " + auto.Brake(50)); } } //calls overloading Brake() method to decrease the current speed to 50
//The screenshot of the output of the program is attached.