Two friends are eating dinner at a restaurant. The bill comes in the amount of 47.28 dollars. The friends decide to split the bill evenly between them, after adding 15% tip for the service. Calculate the tip, the total amount to pay, and each friend's share, then output a message saying "Each person needs to pay: " followed by the resulting number.

Answers

Answer 1
Answer:

Answer:

bill = 47.28

tip = bill * 0.15

total_pay = bill + tip

each_share = total_pay / 2

print("Each person needs to pay: " + str(each_share))

Explanation:

*The code is in Python.

Set the bill

Calculate the tip, multiply the bill by 0.15

Calculate the total_pay, add bill and tip

Calculate each friend's share, divide the total_pay by 2. Then, print it in required format.


Related Questions

A(n) _____ is a harmful program that resides in the active memory of the computer and duplicates itself.WormVirusKeyloggerTimebomb
The utilization of a subset of the performance equation as a performance metric is a pitfall. To illustrate this, assume the following two processors. P1 has a clock rate of 4 GHz, average CPI of 0.9, and requires the execution of 5.0E9 instructions. P2 has a clock rate of 3 GHz, an average CPI of 0.75, and requi res the execution of 1.0E9 instructions. One usual fallacy is to consider the computer with the largest clock rate as having the largest performance. Check if this is true for P1 and P2.
Which of these terms best describes the type of AI used in today’s email spam filters, speech recognition, and other specific applications?A. Artificial Narrow Intelligence (ANI)B. Artificial General Intelligence (AGI)
Write a program whose input is a character and a string, and whose output indicates the number of times the character appears in the string. Ex: If the input is: n Monday, the output is: Ex: If the input is: z Today is Monday, the output is: Ex: If the input is: n It's a sunny day, the output is Case matters. Ex: If the input is: n Nobody, the output is: n is different than N LAB ACTIVTY 4.12.1: LAB: Count characters 6/10 LAB ACTIVTY 4.12.1: LAB: Count characters 6/10 main.cpp Load default template... 1 #include«iostream» 2 using namespace std; 3 int mainO t 4 5 char C; 6 cin c 8 string s; 9 getline(cin, s); 10 11 int ct-0; 12 13 while (s. find(c) != string ::npos ) { 14 ct ct + 1; 15 s = s, find (c, s. find(c) + 1); 16 17 cout << ct << endl; 18 return 0: Total score: 6/10 Latest submission- 3:56 AM on 04/30/19 Only show failing tests Download this submission 1: Compare output 2/2 Input n Monday Your output 1 2: Compare output 2/2 Input z Today is Monday Your output 0 0/2 : Compare output Output differs. See highlights below. Input n It's a sunny day Your output Expected output2 4: Compare output 0/2 Output differs. See highlights below Input t this is a sentence with many t's Your output Expected output 2/2 5: Compare output Input x X Your output 0
suppose you have to implement an operating system on hardware that supports interrupts and exceptions but does not have an explicit trap (syscall) instruction. Can you devise a satisfactory substitute for traps using interrupts and/or exceptions? If so, explain how. If not, explain why. (In this context, the trap instruction is the instruction used by a user-level process to invoke a system call in the operating system, i.e., the trap instruction is the system call instruction

____ means saving data in computer memory.

Answers

Answer: Storage

Explanation:

Storage means means saving data in computer memory. Memory refers to the location which is meant for short-term data, while storage is the part of the computer system that allows an individual to store and also access data on long-term basis.

It should be noted that typically, storage usually comes in form of a hard drive or a solid-state drive.

Two-factor authentication can best be breached by the adversary using:________. a. social engineering attack b. using sniffers like Wireshark and capturing packets c. using rootkits and privilege escalation to get to the kernel processes d. using a virus and destroying the computer that stores authentication information.

Answers

Answer:

a. social engineering attack

Explanation:

Two-factor authentication requires that the user/owner of the account enter a second verification code alongside their password in order to access the account. This code is usually sent to a personal phone number or email address. Therefore in order to breach such a security measure the best options is a social engineering attack. These are attacks that are accomplished through human interactions, using psychological manipulation in order to trick the victim into making a mistake or giving away that private information such as the verification code or access to the private email.

Suppose an array with six rows and eight columns is stored in row major order starting at address 20 (base 10). If each entry in the array requires only one memory cell, what is the address of the entry in the third row and fourth column?

Answers

Answer:

39

Explanation:

Since each of the address occupies only 1 memory cell and the 2-D array is row-major 2-D array.So the elements will be filled row wise.First the first row will be fully filled after that second row and so on.Since we want the address of the element at third row and fourth column.

we can generalize this :

address of the element at ith row and jth column=s + ( c * ( i - 1 ) + ( j - 1 ) ).

s=Starting address.

c=Number of columns in the 2-D array.

address=20+(8*(3-1)+(4-1))

=20+(8*2+3)

=20+16+3

=39

Or you can make a matrix of six rows and eight columns and put first cell with 20.Start filling the elements row wise one by one and look what is the count of 3rd row and 4th column.

Given six memory partitions of 100 MB, 170 MB, 40 MB, 205 MB, 300 MB, and 185 MB (in order), how would the first-fit, best-fit, and worst-fit algorithms place processes of size 200 MB, 15 MB, 185 MB, 75 MB, 175 MB, and 80 MB (in order)? Indicate which—if any—requests cannot be satisfied. Comment on how efficiently each of the algorithms manages memory.

Answers

Using First fit algorithm:

  • P1 will be allocated to F4. With this, F4 will have a remaining space of 5MB from (205 - 200).
  • P2 will be allocated to F1. With this, F1 will have a remaining space of 85MB from (100 - 15).
  • P3 will be allocated F5. With this, F5 will have a remaining space of 115MB from (300 - 185).
  • P4 will be allocated to the remaining space of F1. Since F1 has a remaining space of 85MB, if P4 is assigned there, the remaining space of F1 will be 10MB from (85 - 75).
  • P5 will be allocated to F6. With this, F6 will have a remaining space of 10MB from (185 - 175).
  • P6 will be allocated to F2. With this, F2 will have a remaining space of 90MB from (170 - 80).

Using Best-fit algorithm:

  • P1 will be allocated to F4. With this, F4 will have a remaining space of 5MB from (205 - 200).
  • P2 will be allocated to F3. With this, F3 will have a remaining space of 25MB from (40 - 15).
  • P3 will be allocated to F6. With this, F6 will have no remaining space as it is entirely occupied by P3.
  • P4 will be allocated to F1. With this, F1 will have a remaining space of of 25MB from (100 - 75).
  • P5 will be allocated to F5. With this, F5 will have a remaining space of 125MB from (300 - 175).
  • P6 will be allocated to the part of the remaining space of F5. Therefore, F5 will have a remaining space of 45MB from (125 - 80).
  • 100MB (F1), 170MB (F2), 40MB (F3), 205MB (F4), 300MB (F5) and 185MB (F6).

Using Worst-fit algorithm:

  • P1 will be allocated to F5. Therefore, F5 will have a remaining space of 100MB from (300 - 200).
  • P2 will be allocated to F4. Therefore, F4 will have a remaining space of 190MB from (205 - 15).
  • P3 will be allocated to part of F4 remaining space. Therefore, F4 will have a remaining space of 5MB from (190 - 185).
  • P4 will be allocated to F6. Therefore, the remaining space of F6 will be 110MB from (185 - 75).
  • P5 will not be allocated to any of the available space because none can contain it.
  • P6 will be allocated to F2. Therefore, F2 will have a remaining space of 90MB from (170 - 80).

Properly labeling the six different processes would be:

  • 200MB (P1),
  • 15MB (P2),
  • 185MB (P3),
  • 75MB (P4),
  • 175MB (P5)
  • 80MB (P6).

Best fit algorithm is the best as the name suggests, while the worst fit algorithm is the worst as not all memory is allocated

Read more about memory partitions here:
brainly.com/question/12726841

Answer:

We have six memory partitions, let label them:

100MB (F1), 170MB (F2), 40MB (F3), 205MB (F4), 300MB (F5) and 185MB (F6).

We also have six processes, let label them:

200MB (P1), 15MB (P2), 185MB (P3), 75MB (P4), 175MB (P5) and 80MB (P6).

Using First-fit

  1. P1 will be allocated to F4. Therefore, F4 will have a remaining space of 5MB from (205 - 200).
  2. P2 will be allocated to F1. Therefore, F1 will have a remaining space of 85MB from (100 - 15).
  3. P3 will be allocated F5. Therefore, F5 will have a remaining space of 115MB from (300 - 185).
  4. P4 will be allocated to the remaining space of F1. Since F1 has a remaining space of 85MB, if P4 is assigned there, the remaining space of F1 will be 10MB from (85 - 75).
  5. P5 will be allocated to F6. Therefore, F6 will have a remaining space of 10MB from (185 - 175).
  6. P6 will be allocated to F2. Therefore, F2 will have a remaining space of 90MB from (170 - 80).

The remaining free space while using First-fit include: F1 having 10MB, F2 having 90MB, F3 having 40MB as it was not use at all, F4 having 5MB, F5 having 115MB and F6 having 10MB.

Using Best-fit

  1. P1 will be allocated to F4. Therefore, F4 will have a remaining space of 5MB from (205 - 200).
  2. P2 will be allocated to F3. Therefore, F3 will have a remaining space of 25MB from (40 - 15).
  3. P3 will be allocated to F6. Therefore, F6 will have no remaining space as it is entirely occupied by P3.
  4. P4 will be allocated to F1. Therefore, F1 will have a remaining space of of 25MB from (100 - 75).
  5. P5 will be allocated to F5. Therefore, F5 will have a remaining space of 125MB from (300 - 175).
  6. P6 will be allocated to the part of the remaining space of F5. Therefore, F5 will have a remaining space of 45MB from (125 - 80).

The remaining free space while using Best-fit include: F1 having 25MB, F2 having 170MB as it was not use at all, F3 having 25MB, F4 having 5MB, F5 having 45MB and F6 having no space remaining.

Using Worst-fit

  1. P1 will be allocated to F5. Therefore, F5 will have a remaining space of 100MB from (300 - 200).
  2. P2 will be allocated to F4. Therefore, F4 will have a remaining space of 190MB from (205 - 15).
  3. P3 will be allocated to part of F4 remaining space. Therefore, F4 will have a remaining space of 5MB from (190 - 185).
  4. P4 will be allocated to F6. Therefore, the remaining space of F6 will be 110MB from (185 - 75).
  5. P5 will not be allocated to any of the available space because none can contain it.
  6. P6 will be allocated to F2. Therefore, F2 will have a remaining space of 90MB from (170 - 80).

The remaining free space while using Worst-fit include: F1 having 100MB, F2 having 90MB, F3 having 40MB, F4 having 5MB, F5 having 100MB and F6 having 110MB.

Explanation:

First-fit allocate process to the very first available memory that can contain the process.

Best-fit allocate process to the memory that exactly contain the process while trying to minimize creation of smaller partition that might lead to wastage.

Worst-fit allocate process to the largest available memory.

From the answer given; best-fit perform well as all process are allocated to memory and it reduces wastage in the form of smaller partition. Worst-fit is indeed the worst as some process could not be assigned to any memory partition.

George borrowed some equipment from his friend for recording his monologue for his art class. He got all the equipment except the audio interface. He still went ahead with the recording. What part of George’s laptop functioned as the audio interface in this situation? The *blank* of George’s laptop functioned as the audio interface.

Answers

Answer:

Internal sound card

Explanation:

In this case, George has used an Internal sound card, this is enough to record a podcast, make and receive video conferences or play video games.

If we're going to use an instrument, an external sound card, it's necessary, but in this case, George can make the record with high quality audio.

If George wants to add an adapter to connect 6'35mm but is not the same quality that an external sound card.

An attempt to generate a large number of session IDs and have a server process them as part of a session hijack attempt is known as what type of attack

Answers

Answer:

An attempt to generate a large number of session IDs and have a server process them as part of a session hijack attempt is known as

TCP Session Hijacking.

Explanation:

TCP Session Hijacking is a cyber-attack in which illegitimate access is acquired to a client's server in the network.  The attacker then hijacks the TCP/IP session by reading and modifying transmitted data packets and also sending requests to the addressee's server.  To achieve this attack effectively, the hacker generates a large number of session IDs, thereby confusing the client's server to process them as a part of the users' sessions. Sessions (a series of interactions between two communication end points) are used by applications to store user parameters and, they remain alive until the user logs off.