answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ne4ueva [31]
2 years ago
7

The dealer's cost of a car is 85% of the listed price. The dealer would accept any offer that is at least $500 over the dealer's

cost. Design an algorithm that prompts the user to input the list price of the car and print the least amount that the dealer would accept for the car.
Computers and Technology
1 answer:
san4es73 [151]2 years ago
5 0

Answer:

Explanation:

The following code is writen in Python. It is a function called minPrice. It asks the user to input the list price of the vehicle and then multiplies that by 0.85 in order to get the dealer's cost. Then it adds 500 to that price and returns it to the user as the minimum price that the dealer would accept for the car.

def minPrice():

   list_price = input("Please enter the list price of the car: ")

   dealers_cost = int(list_price) * 0.85

   min_accepted_price = dealers_cost + 500

   print(min_accepted_price)

You might be interested in
Which element of the word program window contains buttons for saving a document and for undoing, redoing, and repeating a change
miskamm [114]
The answer is the Quick Access Toolbar. However, it is not only for saving files or undoing your work. Containing a set of commands that are independent, this toolbar is actually customizable wherein you could change these icons to the ones you really need and frequently use. By tweaking the settings, you can even add commands to the Quick Access Toolbar that are not in the ribbon (like New, Open and Print).
7 0
2 years ago
Karen just finished typing an important memo that she needs to send to many people, including the president of the company. Kare
S_A_V [24]
<span>C. proofread her work carefully, ask a coworker to look it over, and correct all mistakes
</span>
5 0
2 years ago
Read 2 more answers
Import java.util.scanner; public class sumofmax { public double findmax(double num1, double num2) { double maxval; // note: if-e
jeyben [28]

Here you go,


Import java.util.scanner

public class SumOfMax {

   public static double findMax(double num1, double num2) {

       double maxVal = 0.0;

       // Note: if-else statements need not be understood to

       // complete this activity

       if (num1 > num2) { // if num1 is greater than num2,

           maxVal = num1; // then num1 is the maxVal.

       }

       else { // Otherwise,

           maxVal = num2; // num2 is the maxVal.

       }

       return maxVal;

   }

   public static void main(String[] args) {

       double numA = 5.0;

       double numB = 10.0;

       double numY = 3.0;

       double numZ = 7.0;

       double maxSum = 0.0;

       /* Your solution goes here */

       maxSum = findMax(numA, numB); // first call of findMax

       maxSum = maxSum + findMax(numY, numZ); // second call

       System.out.print("maxSum is: " + maxSum);

       return;

   }

}

/*

Output:

maxSum is: 17.0

*/

6 0
2 years ago
Write the definition of a function printAttitude, which has an int parameter and returns nothing. The function prints a message
Oksana_A [137]

Answer:

The function definition, in cpp, for the function printAttitude is given below.

void printAttitude(int n)

{

switch(n)

{

case 1: cout<<"disagree"<<endl; break;

case 2: cout<<"no opinion"<<endl; break;

case 3: cout<<"agree"<<endl; break;

default: break;

}

}

Explanation:

As seen, the method takes an integer parameter.

The method does not returns any value hence, return type is void.

The message is displayed to the console using switch statement which executes on the integer parameter, n.

The values for which output needs to be displayed are taken in cases.

The values for which no output needs to be displayed, is taken in default case.

Every case ends with break statement so that the program execution can be terminated.

This method can be used inside a program as shown.  

PROGRAM

#include <iostream>

using namespace std;

void printAttitude(int n)

{

switch(n)

{

case 1: cout<<"disagree"<<endl; break;

case 2: cout<<"no opinion"<<endl; break;

case 3: cout<<"agree"<<endl; break;

default: break;

}

}

int main() {

// variables to hold respective value

int n;

// user input taken for n

cout<<"Enter any number: ";

cin>>n;

// calling the function taking integer parameter  

printAttitude(n);

return 0;

}

OUTPUT

Enter any number: 11

1. The user input is taken for the integer parameter.

2. Inside main(), the method, printAttitude(), is then called and the user input is passed as a parameter.

3. Since the user entered value is 11 which does not satisfies any of the values in the cases, the default case is entered which does nothing and executes the break statement.

4. Hence, the program displays nothing for the value of 11.

5. When the user enters value 3, the case statement is executed since 3 satisfies one of the case values.

6. The program output for the user input of 3 is as shown below.

OUTPUT

Enter any number: 3

agree

The program ends with return statement.

4 0
1 year ago
1. Discuss why it is so important for all application builders to always check data received from unknown sources, such as Web a
Ivan

Answer:

1. It is so important for all application builders to always check data received from unknown sources before using that data. This is because of the Security related reasons and vulnerabilities .For example the data received might contain harmful hidden viruses.  Web applications are accessed by internet and these are the most vulnerable to attacks by hacker or intruders using harmful data containing malware. This can cause security breaches due to the security flaws or bugs in Web applications. So to overcome such security risks which can cause damage in the Web applications, data from unknown sources should be checked.

Explanation:

2. When the Website is being used and running, there is a room for possible glitches or other bugs and issues. To understand, handle and address  issues successfully, the website operators carefully and consistently patch and configure their systems. The administrators collect the user data which enables them to have enough data in order to make the requisite alterations or improvements in the website. This also helps to improve the website performance. The patching and configuring of systems fix problems in the website which reduces the risk of website damage and the website works smoothly this way. Moreover it identifies vulnerabilities, solve configuration issues and upgrades in website features provide additional capabilities to the website.

8 0
1 year ago
Other questions:
  • The piston engine uses the ________ to convert the reciprocating motion of the piston into rotary motion.
    13·1 answer
  • Leena needs to manually update the TOC and would prefer not to change the styles in the document.
    9·2 answers
  • What is printed by the following program provided all necessary standard header files are included? Explain each line of the out
    10·1 answer
  • Describe the basic features of the relational data model and discuss their importance to the end user and the designer. Describe
    9·1 answer
  • You are using a polynomial time 2-approximation algorithm to find a tour t for the metric traveling salesman problem. Which of t
    7·1 answer
  • How many times is the function wordScramble() called in the given program? public class WordScramble { public static void wordSc
    6·1 answer
  • Write a loop that continually asks the user what pets the user has, until the user enters "rock", in which case the loop ends. I
    12·1 answer
  • g 18.6 [Contest 6 - 07/10] Reverse an array Reversing an array is a common task. One approach copies to a second array in revers
    8·1 answer
  • In this question, you will experimentally verify the sensitivity of using a precise Pi to the accuracy of computing area. You ne
    14·1 answer
  • 4. Why does Hancock believe that our communication online is more honest than we might<br> expect?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!