1answer.
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
Marysya12 [62]
3 years ago
13

Can you help me in this question

Computers and Technology
1 answer:
Amiraneli [1.4K]3 years ago
7 0

Answer:

6 2 and 0

Explanation:

This algorithm doesn't work if the list is not ordered ascending.

In this example it is not, and indeed the item "1" is never found.

first cycle: first=0, last=12 so midpoint=6

second cycle: first=0, last=5 so midpoint=2

last cycle: first=0, last=1 so midpoint=0

then last is assigned -1 so the while statement is no longer true.

You might be interested in
What types of storage can be used to access your data on another computer?
krok68 [10]

Cloud storage is a major option. There is also a USB stick (Memory Stick) and sometimes a hard drive. But, cloud storage is probably the best option because your info can be accessed from anywhere that had internet connections.

Hope this helps!

5 0
3 years ago
Read 2 more answers
2 Manter o autocontrole nos ajuda a evitar muitos problemas na nossa vida pessoal e no ambiente profissional. Em se tratando de
Umnica [9.8K]

Answer:

english please

Explanation:

8 0
3 years ago
a(n) ___ loop allows you to cycle through an array without specifying the starting and ending points for the loop
Arte-miy333 [17]

Answer:

enhanced for loop

Explanation:

Enhanced for loop is an improve concept about loops, this features was implemented in Java SE 5.0 version, this method simplify the For structure. For example:

for (int i = 0; i <array.length; i ++) {  

   System.out.print (array [i]);  

}

Enhanced for loop

for (String element : array) {

   System.out.print(element);

}

8 0
3 years ago
The Yuba College Library would like a program to calculate patron fines for overdue books. Fines are determined as follows: Pape
mestny [16]

Answer:

Explanation:

The following Python code creates all of the necessary functions in order to request and validate all of the inputs from the user. Once everything is entered and validated it calculates the total fee and outputs it to the user. Also calls the entire class at the end using a test variable...

class Customer:

   library_card = 0

   patrons_name = ""

   patrons_address = ""

   type_of_book = ""

   book_title = ""

   days_overdue = 0

   fee = 0.0

   book_list = ['paperback regular', 'paperback best seller', 'magazine', 'hardcover']

   def __init__(self):

       self.library_card = self.get_library_card()

       self.patrons_address = input("Patron's Address: ")

       self.book_title = input("Book Title: ")

       self.type_of_book = self.get_type_of_book()

       self.days_overdue = float(self.get_days_overdue())

       self.calculate_total()

       print("Your total Fee is: " + str(self.fee))

   def get_library_card(self):

       library_card = int(input("Enter 4-digit library card number: "))

       if (type(library_card) == type(0)) and (len(str(library_card)) == 4):

           return library_card

       else:

           print("Invalid Card number:")

           self.get_library_card()

   def get_type_of_book(self):

       type_of_book = input("Type of Book 1-4: ")

       if (int(type_of_book) > 0) and (int(type_of_book) <= 4):

           return int(type_of_book)

       else:

           print("Invalid Type")

           self.get_type_of_book()

   def get_days_overdue(self):

       days_overdue = input("Number of Days Overdue: ")

       if int(days_overdue) >= 0:

           return days_overdue

       else:

           print("Invalid number of days")

           self.get_days_overdue()

   def calculate_total(self):

       if self.type_of_book == 1:

           self.fee = 0.20 * self.days_overdue

           if self.fee > 8:

               self.fee = 8

       elif self.type_of_book == 2:

           self.fee = 0.50 * self.days_overdue

           if self.fee > 15:

               self.fee = 15

       elif self.type_of_book == 3:

           self.fee = 0.25 * self.days_overdue

           if self.fee > 5:

               self.fee = 5

       else:

           self.fee = 0.30 * self.days_overdue

           if self.fee > 23:

               self.fee = 23

test = Customer()

5 0
2 years ago
Which peripheral device is used to record sound?
faust18 [17]

he will need a microphone, it is a recording device.

8 0
3 years ago
Read 2 more answers
Other questions:
  • Which windows tool can you use to find out if the hard drive is slowing down windows performance?
    9·1 answer
  • Problem 1: Create a list that contains the months of the year. Problem 2: Create a loop to print the month number and name (do n
    7·1 answer
  • Types of operating systems
    5·2 answers
  • Write syntactically correct Javascript code to sort an array of sub-arrays containing integers using the sort and reduce array f
    11·1 answer
  • If I'm screen sharing and I plug in a HDMI, will it screen share what the HDMI is plugged into, and can you talk at the same tim
    11·1 answer
  • Complete the following sentence.
    7·1 answer
  • The owner of a candle shop has asked for your help. The shop sells three types of candles as shown below:
    9·1 answer
  • Which step in the software development life cycle analyzes the scope of work?
    6·1 answer
  • I have a problem with my Nintendo DS lite does anyone know how to fix it?
    8·1 answer
  • What are two benefits of defining a function?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!