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
Readme [11.4K]
2 years ago
6

Can you find the reason that the following pseudocode function does not return the value indicated in the comments? // The calcD

iscountPrice function accepts an item’s price and // the discount percentage as arguments. It uses those // values to calculate and return the discounted price. Function Real calcDiscountPrice(Real price, Real percentage) // Calculate the discount. Declare Real discount = price * percentage // Subtract the discount from the price. Declare Real discountPrice = price – discount // Return the discount price. Return discount End Function
Computers and Technology
1 answer:
Alexus [3.1K]2 years ago
5 0

Answer:

see explaination

Explanation:

Function Real calcDiscountPrice(Real price, Real percentage) // Calculate the discount.

Declare Real discount= (price * percentage) / 100.0 // Subtract the discount from the price.

//dividing by 100.0 because of % concept

Declare Real discountPrice = price - discount // Return the discount price.

Return discount End Function

You might be interested in
System design is the determination of the overall system architecture-consisting of a set of physical processing components, ___
Alenkinab [10]

Answer:

C) Hardware, Software, People

Explanation:

System design is the determination of the overall system architecture-consisting of a set of physical processing components, Hardware, Software, People and the communication among them-that will satisfy the system’s essential requirements.

5 0
2 years ago
Read 2 more answers
Given is the array prices with 100 elements(prices[100]). The problem consists of two parts: 1. Find the highest price in the ar
Scrat [10]

Answer:

1. Input array of 100 numbers

mx = 0

for (int i = 0; i < 100; i++)

  if (arr[i] > mx)

      mx = arr[i]

Output mx

2. Input array of 100 numbers

mx = 0

for (int i = 0; i < 100; i++)

  if (arr[i] > mx)

      mx = arr[i]

mx = mx * 0.9

3. Input three numbers

if(firstNumber > secondNumber) {

swap(firstNumber, secondNumber)

}

if (firstNumber > thirdNumber) {

swap(firstNumber, thirdNumber)

}

if (secondNumber > thirdNumber) {

swap(secondNumber, thirdNumber)

}

output firstNumber, secondNumber, thirdNumber

Explanation:

4 0
2 years ago
The video clip on driverless cars explained that brain signals from the individual wearing the headset are converted by computer
Olegator [25]
A saftey issue because what is the car malfunctions or red light or police jus drive yo own car
5 0
2 years ago
Read 2 more answers
2) Complete the get_num_of_characters() function, which returns the number of characters in the user's string. We encourage you
Lilit [14]

Explanation:

Number of characters: 46

String with no whitespace: Theonlythingwehavetofearisfearitself.

########################################################

def get_num_of_characters(inputStr):

   count = 0

   for i in range(0,len(inputStr)):

       count = count + 1

   #count = len(inputStr)

   return count

def output_without_whitespace(inputStr):

   #statement = statement.strip()

   statement2 = ' '

   for i in range(0,len(inputStr)):

        if(inputStr[i] == ' '):

           statement2 = statement2

       else:

           statement2 = statement2 + inputStr[i]

       

   inputStr = inputStr.replace(" ", "")

   return statement2

inputStr = input('Enter a sentence or phrase: ')

print()

print('You entered:', inputStr)

num = get_num_of_characters(inputStr)

print()

print('Number of characters:', num)

print('String with no whitespace:',output_without_whitespace(inputStr))

#if __name__ == '__main__':

   # Think I'm supposed to use this if statement

########################################################

'''ERROR MESSAGE WHEN RUNNING TEST

Unit test

0/1

Tests that get_num_of_characters() returns 46 for "The only thing we have to fear is fear itself."

Your output

Enter a sentence or phrase: Traceback (most recent call last):

 File "zyLabsUnitTestRunner.py", line 4, in <module>

   from zyLabsUnitTest import test_passed

 File "/home/runner/local/unit_test_student_code/zyLabsUnitTest.py", line 1, in <module>

   from main import get_num_of_characters

 File "/home/runner/local/unit_test_student_code/main.py", line 19, in <module>

   inputStr = input('Enter a sentence or phrase: ')

EOFError: EOF when reading a line'''

6 0
2 years ago
___________ device that uses a light source to read characters, marks, and codes and then converts them into digital data that a
kaheart [24]

Answer: Optical Reader

Explanation:

4 0
2 years ago
Other questions:
  • Problem statement: Using loop, write a program that will ask the user to enter a character for left or right. Then, the user wil
    13·1 answer
  • Suppose Dave drops a watermelon off a high bridge and lets it fall until it hits the water. If we neglect air resistance, then t
    12·1 answer
  • Which term describes a process by which malicious code can enter from a non-secure network, and make a hairpin, or sharp turn, a
    6·1 answer
  • Martha has been appointed as the Data Security Manager of her organization. The company wants her to develop a customized app to
    13·1 answer
  • NOTE: in mathematics, division by zero is undefined. So, in C++, division by zero is always an error. Given a int variable named
    9·1 answer
  • Program MATH_SCORES: Your math instructor gives three tests worth 50 points each. You can drop one of the test scores. The final
    7·1 answer
  • Information systems cannot solve some business problems. Give three examples and explain why technology cannot help.
    11·1 answer
  • Assume you have a variable, budget, that is associated with a positive integer. Assume you have another variable, shopping_list,
    11·1 answer
  • Write a function that takes a string like 'one five two' and returns the corresponding integer (in this case, 152). A function j
    11·2 answers
  • Disk scheduling algorithms in operating systems consider only seek distances, because Select one: a. modern disks do not disclos
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!