Given main(), complete the Car class (in file Car.java) with methods to set and get the purchase price of a car (setPurchasePrice(), getPurchasePrice()), and to output the car's information (printInfo()).
Ex: If the input is:_______.
2011
18000
2018

Answers

Answer 1

Answer:

Explanation:

This a java code for a car and can be written as follows:

public class Car {

   private int modelYear;

   private int purchasePrice;

   private int currentValue;

   public int getModelYear() {

       return modelYear;

   }

   public void setModelYear(int modelYear) {

       this.modelYear = modelYear;

   }

   public int getPurchasePrice() {

       return purchasePrice;

   }

   public void setPurchasePrice(int purchasePrice) {

       this.purchasePrice = purchasePrice;

   }

   public int getCurrentValue() {

       return currentValue;

   }

   public void calcCurrentValue(int year) {

       int age = year - modelYear;

       currentValue = (int) Math.round(purchasePrice * Math.pow(0.85, age));

   }

   public void printInfo() {

       System.out.println("Car's information:");

       System.out.println("   Model year: " + modelYear);

       System.out.println("   Purchase price: " + purchasePrice);

       System.out.println("   Current value: " + currentValue);

   }

}


Related Questions

In the rapid application development (RAD) model, the _____ phase focuses on program and application development tasks similar to the SDLC.A) requirements planningB) user designC) constructionD) cutover

Answers

Answer:

C) construction

Explanation:

Rapid application development abbreviated RAD is an agile software development strategy that reduces time spent on planning so that prototype development takes priority and project turnaround time is greatly reduced consequently. There are four phases in rapid application development :

requirements planning, user design, construction, cutover

The construction phase is the third stage in rapid application development. This stage builds on the progress of the previous stages- the requirements planning stage and user design stage- to go ahead to finalize the application development which has been agreed on through iterations and communication between developer and client in the user design stage. In other words, this stage basically takes the ideas, prototypes and beta products from the previous stages and makes it into a real final product. The rationale or perks behind this is that other problems such as what product would do or look like or any changes or modifications have been worked out in previous stages thereby speeding up development in this stage.

What is the purpose of a poster frame?
to allow the contents of an embed code to be displayed
to insert a downloaded video for offline playback and editing
to create the frame in which a screen recording will be inserted
to capture a portion of a video clip to show as a preview image

Answers

Answer: the last one

Explanation:

Here is the answer::

ASAP PLZ!!!. Which command group is used to apply effects and modify color schemes of SmartArt graphics?

Reset Graphics

SmartArt Styles

Graphic Layouts

Create Graphics

NVM!! The answer is B. SmartArt Styles

Answers

Answer:

I think I am wrong but I assume it is C. Graphic Layout Sorry if I am wrong but if I am not please reward me brainlist.

The answer is B. Smart Art styles because your adding a styles to SmartArt

Just took a test and I got 5 wrong and I wanted to know the correct answers

Answers

Answer:

I need the pic

Explanation:

Can someone help me to write a python code to save list form python to CSV file please?​

Answers

f = open("MyFileName.csv", "w")

lst = ["Hello", "Hi", "Bye"]

f.write(str(lst))

f.close()

I didn't necessarily know what you meant by list form. This program works for me in pycharm. I had to install the CSV plugin though. If you encounter any errors, I'll try my best to help you.

An important communication principle states ""prepare before you communicate."" How should this preparation manifest itself in the early work that you do? What work products might result as a consequence of early preparation?

Answers

Answer:

Planning is very important before communicating a product to others.

Explanation:

We should always prepare well about what we are going to communicate to others. We should know the topic properly or know about the product before we speak about it in front of others. We should understand the concept of the product before we communicate it to others.

Planning is also an important before going to speak or communicate.

Before communicating a product to others, we should prepare :

1. We should very well understand the concept of the product also its scope. The scope will provide product team with the destinations.

2. We should keep in mind to involve the valuable customers in our plannings.They defines the priorities of the product.

3. We should recognize that the planning is highly iterative.

4. We should do a market research or study or the business domain that the product will address.

5. We should understand the different stakeholders and their requirements and be open to negotiations.

It is vital to prepare in every communication as your success  depends on it. One can prepare by researching on the area we want to talk about and practicing one's speech.

Why do we need to prepare in communication?

The success one has in communicating is said to be a skill that is often used in a lot of field of work.

Conclusively, It is vital that a person do  prepare to communicate well when they have been given the opportunity to do so and this involves a lot of research and practice.

Learn more about preparation of manifest  from

https://brainly.com/question/13524298

For the function below, which variables have the same scope?

def square(numA, numB):

return numA ** numB

base = 5
power = 2
answer = square (base,power)
print(answer)


numA and power

power and base

numB and power

base and numA

Answers

Answer:

numB and power

Explanation:

Correct answer edge 2020

The variables have the same scope for the given function is power and base. The correct option is B.

What are variables?

A variable in mathematics is a symbol and placeholder for any mathematical object. A variable can specifically represent a number, a vector, a matrix, a function, a function's argument, a set, or an element of a set.

A variable in computer programming is an abstract storage location with an associated symbolic name that contains some known or unknown quantity of information referred to as a value; or, to put it another way, a variable is a named container for a specific set of bits or type of data.

Because power and base are declared in the same container, they have the same scope. Because they are not present in a function, their scope is said to be global.

Thus, the correct option is B.

For more details regarding variables, visit:

https://brainly.com/question/17344045

#SPJ2

_decisions are more common at lower organizational levels

Answers

Which of the following is not a characteristic of a structured decision?

The first three phases of the decision-making process need not occur in any particular sequence.

Structured

________ decisions are more common at lower organizational levels.

Operational control

_____ is the efficient and effective execution of specific tasks.

unstructured

When there is no well-understood or agreed-on procedure for making a decision, the decision is said to be:

Users didn't have the right tools to access the data.

Refer to the Opening Case - Quality Assurance at Daimler AG: Which of the following best describes Daimler's Quality Information System (QUIS)?

digital dashboards

Which of the following information systems are very user friendly, supported by graphics, and provide exception reporting and drill down?

The number of alternatives is decreasing.

Which of the following is not a reason why managers need IT support?

implementation

Success in the _____ phase of the decision-making process results in resolving the original problem, and failure leads to a return to previous phases.

interpersonal

Being a figurehead and leader is part of the _____ managerial role.

Pleases Help ME An example of a _________________ impact is when a product is back ordered and the business contacts the customer via email to let them know of the new ship date.


A)Negative



B)Positive

Answers

Answer:

positive

Explanation:

it shows good customer service

plssss help i will mark u as brainliest plssss ​

Answers

Answer:

Explanation:

<p style="color: red">Random Name 1</p>

<p style="color: blue">Random Name 2</p>

<p style="color: yellow">Random Name 3</p>

<p style="color: green">Random Name 4</p>

<p style="color: gray">Random Name 5</p>

<ol>

   <li>Pen 1<li>

   <li>Pen 2<li>

   <li>Pen 3<li>

<ol>

<ul>

   <li>CPU<li>

   <li>Motherboard<li>

   <li>RAM<li>

   <li>GPU<li>

<ul>

I think is this you need, have a nice day ;)

express cards functionalities​

Answers

Answer:

ExpressCard, initially called NEWCARD, is an interface to connect peripheral devices to a computer, usually a laptop computer. The ExpressCard technical standard specifies the design of slots built into the computer and of expansion cards to insert in the slots.

Which of the following online activities seem appropriate for the workplace? (select all that apply) A.watching a webinar to learn new job skills
B.watching TV online
C. seeking donations to support your election to the Senate
D. reading press releases from your company's competitors
E. sharing career advice with your peers
F. sharing company secrets in a public forum​

Answers

Answer:

A, D, and E

watching a webinar to learn new job skills

reading press releases from your company’s competitors

sharing career advice with your peers

Explanation:

got it right on edge2020

The online activities that seem appropriate for the workplace  is sharing career advice with your peers.

What are virtual activities?

The virtual activities are known to be any kind of online activities that is often done by people to make sure they have good and continued collaboration with other people.

Conclusively, Note that the use of online activities in the workplace should be the one that will help you and your peers to grow such as  sharing career advice with your peers.

Learn more about  online activities  from

https://brainly.com/question/13171394

solve the system of equations and choose the correct ordered pair.

4x+5y=22
2x+3y = 12

Answers

Answer:

(3,2) x = 3, y = 2

Explanation:

Assume that you want two C# or C++ programs to share some data. You can write the first program so that it writes it's output to a file, and then write the second program so that it reads the data from this file. However this process can be difficult and time consuming, especially if you don't know how to program in C# or C++. What feature of the UNIX/Linux shell can you use to simplify the process of sharing data between programs?

Answers

Certain ways exist to simplify the process of data sharing between programs.some of these ways are;

A) When there are two programs that are not running at the same time,then the pipes or the sockets won't be able to work as their buffers would not be able to hold large files because they are small.

Looking at this scenerio,shared memory can be used.

The Sysv IPC shared memory API, POSIX shared the memory API or rather files on a tmpfs system of files can actually be used for shared memory operations.

B) Another possible solution can be named file. Instead of using an unnamed and shell pipeline,a name pipeline them uses the file system.

However,it can be treated with the use of mkfifo() or mknod() commands and then two separate programs or also processes can as well access the pipe by making use of the name of the pipe.

But one process(program) can actually open the pipe but as a reader for reading purposes and the other for writing purposes as a writer.

4.8 code practice question 2 edhesive

Answers

Answer:

for y in range(88, 43, -4):

   print(y, end=" ")

Explanation:

yw

The code practice is an illustration of loops;

Loops are program statements that are used to perform iterative operations

The complete program in Python

The program in Python, where comments are used to explain each action is as follows:

#This iterates from 88 to 42, with a difference of -4

for i in range(88, 43, -4):

#This prints the numbers on a single line

   print(i, end=" ")

Read more about loops at:

https://brainly.com/question/24833629

#SPJ2

What is the minimum size of a data type, in bytes, to be impacted by system endianness. (Whole numbers only)?

Answers

Answer:

30

Explanation:

A data type must be at least 2 bytes in size to be affected by the endianness system.

What is endianness system?

Endianness in computing refers to the arrangement of bytes inside a word of digital data stored in a computer's memory.

Big-endian or little-endian are the two main ways that endianness is stated.

The least significant byte in a word is kept at the largest memory location and the most significant byte is kept at the smallest address in a big-endian system.

The term "endianness" refers to the arrangement of bytes as they are stored in computer memory. Endianness is classified as big or little depending on which value is stored first.

Thus, for the endianness system to apply, a data type must be at least 2 bytes in size.

For more details regarding endianness system, visit:

https://brainly.com/question/14488920

#SPJ6

write a C++ program that ask the user for the number of cookies eaten and display the calorie consumption

Answers

Answer:

#include <iostream>

using namespace std;

int main()

{

   int cookies;

   cin >> cookies;

   cout << "The calorie consumption is: " << cookies * 142 << endl;

   return 0;

}

Explanation:

First line: include basic library of C++(input and output).

using namespace std;

Says to compiler we are using std.

int main() Main function

int cookies, cookies variable, of int type

cin >> cookies

get the number of the cookies from user

cout Print the text and calories(one cookie have 142 calories)

Have a nice day ;)

Define a function pyramid_volume with parameters base_length, base_width, and pyramid_height, that returns the volume of a pyramid with a rectangular base.

Answers

Answer:

Define a function pyramid_volume with parameters base_length, base_width, and pyramid_height, that returns the volume of a pyramid with a rectangular base.

Explanation:

thats all you said

In python 3.8:

def pyramid_volume(base_length, base_width, pyramid_height):

   return round((base_length*base_width*pyramid_height)/3,2)

print(pyramid_volume(1,1,2))

I used the round function to round the volume to 2 decimal places. You can change this if you need more or less precision. I hope this helps!

____________________________ and _________________________ are 2 positive impacts of the internet on businesses.

A)Competition and Easy Marketing


B)Improved Communication and Worrying security


C)Improved Communication and Increased unnecessary competition


D)Improved Communication and Easy Advertisement

Answers

D improved comms and easy ads

Answer:

D)due to it we can have more profit with less time and wide area communication

How goes design again ones attention?

Answers

Answer:

the only thing i could think of is creating a different way to get someone to pay attention to you like maybe instead of shouting or tapping on ones shoulder maybe try to ask the person closest to them to get their attention for you. or by doing something extremely impressive or distracting

Explanation:

Which of the following is considered an input device?

Answers

Do you have a picture or list?

Answer:

Keyboard

Mouse

Light pen

Microphone

Touch pad

Why is content knowledge as important as generalized critical thinking for Web Analytics and Web Intelligence reporting and insights? A) Because it's very difficult for students to apply critical thinking skills learned in one subject to another, even between different fields of science. B) It is said that content is king and that having up to date content knowledge of Web Analytics is crucial in order to be an effective Analyst C) Everything is changing so fast that you need to keep up to date with the changes in the platforms that you use or are considering using for personal or organizational deployment. D) Content knowledge of Web Analytics is important because in a field like emerging technology that Web Analytics is still considered to be, new features of a Web Analytics platform can have a major impact on the ability to do the project and deliver value from it.

Answers

Answer:

B) It is said that content is king and that having up to date content knowledge of Web Analytics is crucial in order to be an effective Analyst

Explanation:

The answer is option B. A good knowledge of content is very important and crucial due to the fact that knowledge stands at the center or the most important thing in the business sector.

Web analytics is a method of measuring, analysing and reporting web usage data. Content knowledge is a good understanding of the subject area. To understand web analytics, a going knowledge of the facts, theories and concepts are important if one wants to be an effective analyst.

Therefore b is the answer to this question.

Which of the following are reasons why it is important to write readable code?
Choose all that apply.

Readable code is easier to maintain.

Readable code is easier to modify.

Readable code is fun to write.

Writing readable code saves time in the long run.

Answers

Answer:

Readable code is easier to maintain.

Writing readable code saves time in the long run.

Readable code is easier to modify.

Readable code is fun to write.

Explanation:

Readability of a code means that how easy it is to read the code even if any person other than programmer reads the code. Different techniques like line breaks and indentation are used to make the code readable. the program follows an indentation pattern so it is easy and fun to write.

Hence,

it can be concluded that the true statements are:

Readable code is easier to maintain.

Writing readable code saves time in the long run.

Readable code is easier to modify.

Readable code is fun to write.

Answer:

for short answer it is a,b and D

Explanation:

What is the first step a user should take toward generating an index?

--finding and marking words or phrases that should be included in the index
--making sure that headers at different levels are using consistent styles
--bolding every word or phrase that should be included in the index
--writing down information about the author and publisher of other books used

Answers

Answer:

I think that it's A

Explanation:

During periods when the internet is not slowed by congestion, the number of internet searches is probably close to the socially efficient number. how can we tell this this is true?

Answers

Answer:

We can this is true because the number of internet searches that are being done at that time is just enough to meet the actual capacity of the internet facility.

Explanation: Socially efficient number is that number that is just enough to meet the actual capacity of a given system such as an internet connectivity or internet facility.

When the number of internet searches are just enough not to cause congestion in the search engines or internet facility,it can be said that the socially efficient number has been achieved.

How does natural gas move through pipelines from the well head to the end user thousands of miles away

Answers

It’s the large compressors that are pumping and working together through the different stations ... They move the gas through the pipelines which they’re under high pressure.

the formula to calculate percentage is the same as which other functions

Answers

Answer:

Division

Explanatio

Answer: everyone’s saying division, so I’m guessing the correct answer is division

Explanation: hope y’all have a blessed day

Before radio, many minority musicians were severely limited by the prejudice of the era. true o rfalse

Answers

Answer:

True

Explanation:

Minoritys have always faced prejudice

Write a program (main method) that advises the user on programming language. So if a user for instance enters "Java" the program might say "awesome" or if the user enters "Ruby" it might say "are you sure?" . Make the program comment on at least 5 programming languages.

Answers

import java.util.Scanner;

public class JavaApplication41 {

   

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       String language = scan.nextLine();

       if (language.toLowerCase().equals("java")){

           System.out.println("Awesome!");

       }

       else if (language.toLowerCase().equals("python")){

           System.out.println("A very simple language!");

       }

       else if (language.toLowerCase().equals("ruby")){

           System.out.println("Are you sure?");

       }

       else if (language.toLowerCase().equals("javascript")){

           System.out.println("Easy enough");

       }

       else if (language.toLowerCase().equals("c")){

           System.out.println("Cool!");

       }

   }

   

}

I hope this helps!


Martin is responsible for translating the script into a visual form by creating a storyboard. Which role is he playing?
Martin is playing the role of a(n)

Answers

Answer:

The correct answer to this question is given below in the explanation section.

Explanation:

The question is about to  identify the role of Martin, who converts script into visual form by creating a storyboard.

The correct answer to this question is:

Martin is playing the role of Production Design and he is working at the position of the production designer.

Before shooting a film, the production designer is the first artist who converts script into a visual form such as creating storyboards. And, that storyboard serves as the first film draft.

A storyboard is a series of sketches, paintings, etc arranged on a panel to show the visual progress of the story from one scene to the next.   These storyboards are used from start to finish of the film. Because these storyboards or sketches serve as the visual guide for the director of the film throughout the production.  

Answer:

Hi

Explanation:

THE ANSWER UP TOP IS WRONG LIKE DEAD WRONG

Other Questions
You go to the carnival, and how much you spend can be written as .50r + 15, where r = rides. What can the 15 mean?? What does the 50 mean?? can someone help me with this? Which of the following is the graph of the solution set of:y< -3 or y BRAINLIEST TO WHOEVER ANSWERS FIRST!!Which two statements, if true guarantee that is congruent to B?Choose 2 answersFGBFDHBFHIDHHI FG How is the phrase, you are what you eat, related to metabolism? Explain what that means. 393.3 in 10 years investment can someone help me asapp what about a person born in France whose parents are both American citizens ?is a yes or no question a, b, c, d. first to answer gets brainliest PLEASE HELP IF YOU NEED ME TO TELL YOU THE INFO FOR A.) I WILLb) During the shot put event, Alayna throws the ball 32.45 feet while her teammatesthrow 28.34 feet, 26.59 feet, and 33.11 feet. Use an estimation strategy to determine about how many total feet were thrown by the team. Describe the estimation strategy you used to solve the problem. (2 points) Which atom in the following sets has the larger atomic radius?a. Rn, Ne, Ar, Kr b. Hg, Cs, Po, W c. Mg, P, Al, Ar Graph f(x)=-2|x+4| khan academy Find the length of a rectangular lot with a perimeter of 144 m if the length is 6 m more than the width. A. 72m B. 39 mC. 33 mD. 78 m Birth weights at a local hospital have a Normal distribution, with a mean of 110 oz and a standard deviation of 15 oz. The proportion of infants with birth weights below 125 oz is: A. .500B. .159C. .341D. .841 Write 10-15 facts about JFK and his assassinationpls answer seriously. Una antena de televisin ser sujeta con un cable de 6 m de longitud de la parte superior de la misma, a una argolla que se encuentra en el piso de la azotea, con un ngulo de inclinacin de 60 con respecto al piso, qu longitud tiene la antena? I need 4 answers , The cost per pound of the apples on sale is $.The cost per pound of the apples on sale is $___.You can buy pounds of apples for $18.00 ___Since 1 pound = 16 ounces, so there are about ___ apples in each pound.You can buy approximately ____ apples for $18.00. Please help me....... Answer these pls its my homework thank you Penny used to drive 3.36 miles to school. Then, she moved 1.29 miles closer toschool. How far does Penny have to drive to school now?