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
mixas84 [53]
2 years ago
15

Find the error in the following pseudocode.

Computers and Technology
1 answer:
Ber [7]2 years ago
5 0

Answer:

Following are the error in the given program are explain in the explanation part .

Explanation:

The main() function call the function getMileage() function after that the control moves to the getMileage() definition of function. In this firstly declared the  "mileage" variable after that it taking the input and module is finished we see that the "mileage" variable is local variable i,e it is declared inside the  " Module getMileage() "  and we prints in the main module that are not possible to correct these we used two technique.

Technique 1: Declared the mileage variable as the global variable that is accessible anywhere in the program.

Technique 2: We print the value of  "mileage" inside the Module getMileage() in the program .

You might be interested in
Which of the following people is required by law to wear a seat belt? A. The operator of a truck weighing more than 26,000 lbs B
mars1129 [50]
A, because you can't wear a seat belt if you are throwing newspaper out the car, school buses don't have seat belts and neither did trucks back in the 70's
3 0
1 year ago
The overall purpose of CSS is to modify the way web pages look without modifying the underlying HTML code. way tables render in
dedylja [7]
Hi!

The purpose of CSS is to edit and change the appearance of a website without having to go and change any of the HTML code.

Hopefully, this helps! =)
5 0
1 year ago
Read 2 more answers
#Write a function called fancy_find. fancy_find should have #two parameters: search_within and search_for. # #fancy_find should
Inessa05 [86]

Answer:

Here is the Python program:

def fancy_find(search_within , search_for):  # function definition of fancy_find function that takes two parameters

   index = 0  #to store the index of search_within where the search_for string is found

   if search_for in search_within:  #checks if the string search_for is present in string search_within

       sf = search_for[0]  #points to the first character of the search_for

       for sw in search_within:  #iterates through search_within

           if sw == sf:  #if the first character of search_for is equal to the character at sw index of search_within

               if search_within[index:index+len(search_for)] == search_for:  #checks if the value of search_for is found in search_within

                   print(search_for,"found at index",index,"!")  #if above condition is true prints the message "[search_for] found at index [index]!", with [search_for] and [index] replaced by the value of search_for and the index at which it is found

                   return ""  

           index += 1  #increments value of index at each iteration

   print(search_for,"is not found within", search_within)  #if search_for is not found within search_within, prints message "[search_for] was not found within [search_within]!" with the values of search_for and search_within.

   return ""    

#following two statements are used to test the working of above function

print(fancy_find("ABCDEF", "DEF"))  #calls fancy_find() passing "ABCDEF" as search_within and "DEF" as search_for

print(fancy_find("ABCDEF", "GHI")) #calls fancy_find() passing "ABCDEF" as search_within and "GHI" as search_for

Explanation:

The program is well explained in the comments. I will explain the working of the function with the help of an example:

Suppose

search_within = "ABCDEF"

search_for = "DEF"

We have to find if search_for i.e. DEF is present in search_within i.e. ABCDEF

if search_for in search_within statement checks using in operator that if DEF is included in ABCDEF. Here this condition evaluates to true so the next statement sf = search_for[0]  executes which sets the first element of search_for i.e. D to sf. So sf = 'D'

for sw in search_within this statement has a for loop that iterates through ABCDEF and works as following:

At first iteration:

sw contains the first character of search_within  i.e. A

if sw == sf: condition checks if the first character of the search_for i.e. D is equal to sw i.e. A. Its not true so the program control moves to this statement:

index += 1 This increases the value of index by 1. index was initialized to 0 so now it becomes 1. Hence index=1

At second iteration:

sw contains the second character of search_within  i.e. B

if sw == sf: condition checks if the first character of the search_for i.e. D is equal to sw i.e. B Its not true so the program control moves to this statement:

index += 1 This increases the value of index by 1. index was initialized to 0 so now it becomes  2. Hence index=2

At third iteration:

sw contains the third character of search_within  i.e. C

if sw == sf: condition checks if the first character of the search_for i.e. D is equal to sw i.e. C Its not true so the program control moves to this statement:

index += 1 This increases the value of index by 1. index was initialized to 0 so now it becomes  3. Hence index=3

At fourth iteration:

sw contains the third character of search_within  i.e. D

if sw == sf: condition checks if the first character of the search_for i.e. D is equal to sw i.e. D. Its true so so the program control moves to this statement:

  if search_within[index:index+len(search_for)] == search_for:

current value of index=3

len(search_for) returns the length of DEF i.e. 3

So the if condition checks for the search_for in search_within. The statement becomes:

if search_within[3:3+3] == search_for:

search_within[3:3+3]  means from 3rd index position of search_within to 6-th index position of the search_within. This means from 4th element of search_within i.e. D to the last. Hence search_within[3:3+3] is equal to DEF.

search_for = DEF so

if search_within[3:3+3] == search_for: checks if

search_within[3:3+3] = DEF is equals to search_for = DEF

Yes it is true so

print(search_for,"found at index",index,"!") statement is executef which prints the following message:

DEF found at index 3!

This output is because search_for = "DEF" and index=3

5 0
2 years ago
You would use the _______ conditional formatting options when analyzing a worksheet in which you want to highlight the highest o
nirvana33 [79]

Answer:

Top/bottom conditional formatting

Explanation:

The top/bottom conditional formatting automatically carries out the task of finding the highest, lowest and even average values.

Conditional formatting formatting gives one the opportunity to enhance reports and dashboards as they work on excel.

You use the too/bottom formatting to highlight cells whose values of highest in a dataset and lowest in a dataset

4 0
1 year ago
Modern operating systems decouple a process address space from the machine’s physical memory. List two advantages of this design
kolbaska11 [484]

Answer: Decoupling action of the process address space refers to the physical memory of the device getting decoupled to provide  address translation in automatic way. The benefit of this method is as follows:-

  • Faster starting up of the program
  • The physical address space gets managed on its own
  • Helps in execution of large program when the main memory of the machine is of  smaller size in comparison with program

7 0
2 years ago
Other questions:
  • Which of the registration patterns is best suited for complex architecture? A. Client side discovery pattern B. Third party regi
    13·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
  • Budget Analysis (use while loop) Write a program that asks the user to enter the amount that he or she has budgeted for a month.
    5·1 answer
  • Our new catalog contains an eclectic collection of items
    6·1 answer
  • Probability of theft in an area is 0.03 with expected loss of 20% or 30% of things with probabilities 0.55 and 0.45. Insurance p
    5·1 answer
  • A security administrator is implementing a SIEM and needs to ensure events can be compared against each other based on when the
    11·1 answer
  • The geographic coordinate system is used to represent any location on Earth as a combination of latitude and longitude values. T
    5·1 answer
  • Which of the following could NOT be represented by a boolean variable?
    8·1 answer
  • A credit card company receives numerous phone calls throughout the day from customers reporting fraud and billing disputes. Most
    10·1 answer
  • Which is the correct notation to specify the following inheritance?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!