You have been hired to create a Grilled Rump Steak ordering app. The app should have a class named GrilledRumpSteak which contains data about a single rump. The GrilledRumpSteak class should include the following:
▪ Private instance variables to store the size of the rump (either small, medium, or large), the number of salsa toppings, the number of tomato toppings, and the number of mushroom toppings.
▪ Constructor(s) that set all the instance variables.
▪ Public methods to get and set the instance variables.
▪ A public method named calcCost( ) that returns the cost of the rump as a double. The Grilled
Rump Steak cost is determined by: Large: R200 + 30 per topping Medium: R150 + R20 per
topping Small: R120 + R15 per topping
▪ public method named getDescription( ) that returns a String containing the rump size, quantity
of each topping.
Write test code to create several grilled rump steaks and output their descriptions. For example, a large rump with one salsa, one tomato, and two mushroom toppings should cost a total of R320. Now Create a GrilledRumpSteakOrder class that allows up to three grilled rump steaks to be saved in order. Each grilled rump steak saved should be a GrilledRumpSteak object. Create a method calcTotal() that returns the cost of the order

Answers

Answer 1

[tex] \boxed{ \red{ \sf Answer}}[/tex]

Here's an implementation of the GrilledRumpSteak class with the required features:

```java

public class GrilledRumpSteak {

private String size;

private int salsaToppings;

private int tomatoToppings;

private int mushroomToppings;

public GrilledRumpSteak(String size, int salsaToppings, int tomatoToppings, int mushroomToppings) {

this.size = size;

this.salsaToppings = salsaToppings;

this.tomatoToppings = tomatoToppings;

this.mushroomToppings = mushroomToppings;

}

public String getSize() {

return size;

}

public void setSize(String size) {

this.size = size;

}

public int getSalsaToppings() {

return salsaToppings;

}

public void setSalsaToppings(int salsaToppings) {

this.salsaToppings = salsaToppings;

}

public int getTomatoToppings() {

return tomatoToppings;

}

public void setTomatoToppings(int tomatoToppings) {

this.tomatoToppings = tomatoToppings;

}

public int getMushroomToppings() {

return mushroomToppings;

}

public void setMushroomToppings(int mushroomToppings) {

this.mushroomToppings = mushroomToppings;

}

public double calcCost() {

double cost;

switch (size) {

case "Large":

cost = 200 + salsaToppings * 30 + tomatoToppings * 30 + mushroomToppings * 30;

break;

case "Medium":

cost = 150 + salsaToppings * 20 + tomatoToppings * 20 + mushroomToppings * 20;

break;

default:

cost = 120 + salsaToppings * 15 + tomatoToppings * 15 + mushroomToppings * 15;

}

return cost;

}

public String getDescription() {

return size + " rump with " + salsaToppings + " salsa toppings, " + tomatoToppings + " tomato toppings, and " + mushroomToppings + " mushroom toppings";

}

}

```

And here's an implementation of the GrilledRumpSteakOrder class that allows up to three grilled rump steaks to be saved in order:

```java

public class GrilledRumpSteakOrder {

private GrilledRumpSteak[] rumpSteaks;

private int count;

public GrilledRumpSteakOrder() {

rumpSteaks = new GrilledRumpSteak[3];

count = 0;

}

public void addRumpSteak(GrilledRumpSteak rumpSteak) {

if (count < 3) {

rumpSteaks[count] = rumpSteak;

count++;

}

}

public double calcTotal() {

double total = 0;

for (int i = 0; i < count; i++) {

total += rumpSteaks[i].calcCost();

}

return total;

}

}

```

To test the classes, we can create several GrilledRumpSteak objects and output their descriptions, then create a GrilledRumpSteakOrder object, add the rump steaks to it, and calculate the total cost of the order:

```java

public static void main(String[] args) {

GrilledRumpSteak rump1 = new GrilledRumpSteak("Large", 1, 1, 2);

GrilledRumpSteak rump2 = new GrilledRumpSteak("Medium", 2, 0, 1);

GrilledRumpSteak rump3 = new GrilledRumpSteak("Small", 0, 3, 0);

System.out.println(rump1.getDescription()); // Output: Large rump with 1 salsa toppings, 1 tomato toppings, and 2 mushroom toppings

System.out.println(rump2.getDescription()); // Output: Medium rump with 2 salsa toppings, 0 tomato toppings, and 1 mushroom toppings

System.out.println(rump3.getDescription()); // Output: Small rump with 0 salsa toppings, 3 tomato toppings, and 0 mushroom toppings

GrilledRumpSteakOrder order = new GrilledRumpSteakOrder();

order.addRumpSteak(rump1);

order.addRumpSteak(rump2);

order.addRumpSteak(rump3);

System.out.println("Total cost: R" + order.calcTotal());


Related Questions

8.6 Code Practice: Question 1 Python
Write a function named "buildList" that builds a list by appending a given number of random integers from 100 to 199 inclusive. It should accept two parameters — the first parameter is the list, and the second is an integer for how many random values to add, which should be input by the user.
Print the list after calling "buildList". Sort the list and then print it again.

Sample Run
How many values to add to the list:
10
[141, 119, 122, 198, 187, 120, 134, 193, 112, 146]
[112, 119, 120, 122, 134, 141, 146, 187, 193, 198]

Answers

Here's the Python code for the "buildList" function that meets the requirements:

The Python Code

import random

def buildList(lst, num):

   for i in range(num):

      lst.append(random.randint(100, 199))

lst = []

num = int(input("How many values to add to the list:\n"))

buildList(lst, num)

print(lst)

lst.sort()

print(lst)

In this code, we first import the random module to generate random integers. The buildList function takes two parameters, lst which is the list to which the random integers will be appended and num which is the number of random integers to generate and append to the list.

The buildList function uses a for loop to iterate num times, and in each iteration, generates a random integer between 100 and 199 (inclusive) using the random.randint function and appends it to the list.

We then call the buildList function with the input values for lst and num provided by the user. We print the list using the print function, then sort the list using the sort method and print it again.

Read more about python here:

https://brainly.com/question/26497128

#SPJ1

Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in reverse binary. For an integer x, the algorithm is:

As long as x is greater than 0
Output x % 2 (the remainder is either 0 or 1)
x = x / 2
Note: The above algorithm outputs the 0's and 1's in reverse order.

Ex: If the input is:

6
the output is:

011
6 in binary is 110; the algorithm outputs the bits in reverse.

Answers

Below is the Python code to accomplish this:

python

# take input from user

decimal_num = int(input("Enter a positive integer: "))

# initialize an empty string to hold the binary digits

binary_string = ""

# convert the decimal number to binary and store in binary_string

while decimal_num > 0:

   binary_string += str(decimal_num % 2)

   decimal_num = decimal_num // 2

# output the binary string in reverse order

print(binary_string[::-1])

What is the program about?

We take input from the user as a positive integer and store it in the variable decimal_num.

We initialize an empty string binary_string to hold the binary digits.We convert the decimal number to binary by repeatedly dividing by 2 and storing the remainder (0 or 1) in binary_string.

Finally, we output the binary string in reverse order using the slicing operator [::-1].

Read more about program here:

https://brainly.com/question/23275071

#SPJ1

Why would an organization have a heterogeneous DDBMS?

Answers

The aims of a heterogeneous DDBMS are : - to allow the users to manipulate the distribu- ted database like a unique database and with the language they use to practice, - to make possible the integration of an existing database in the DDBMS.

Create a pseudo code for calculate the sum of squares of given input of numbers

Answers

Put a "0" in sum_of_squares. Calculate the square of each input integer, then add it to sum_of_squares. Sum_of_squares's final number should be printed.

What is pseudo-code made of?

Pseudocode is a loosely defined type of programming description that is unrestricted by underlying technology or strict programming language syntax. It is used to draught a programme's initial draught or outline.

How is a number entered into pseudocode?

The pseudocode expression INPUT() can be used to request human input. Like DISPLAY(), it functions exactly like a procedure but doesn't need any inputs. Instead, the evaluation of the INPUT() expression will merely produce the user-supplied input value.

To know more about sum_of_squares. visit:

https://brainly.com/question/2516345

#SPJ9

PLS HELP
Which is not involved in an action plan for creating a computer program?
A) making a schedule
B) defining testing
C) planning each phase
D) creating a flowchart

Answers

The answer is C planning each phase

Answer:

The answer is A) making a schedule. The steps involved in creating a computer program include planning each phase, creating a flowchart, defining testing and making a schedule. Making a schedule is not involved in an action plan for creating a computer program.

Hope This Helps!

Large and small app buttons on the right side of the start menu

Answers

Answer:

the are known as "tiles"

application for merged documents mass producing contracts

Answers

Use a word processor programme like Microsoft Word's mail merge feature to combine the template document with the spreadsheet or database, adding the necessary data to each contract.

What are the advantages of mail combining when creating contracts in bulk?

Mail merge produces mass mailings complete with labels or envelopes while saving time and effort compared to the process of creating individual letters to communicate one piece of information to a large number of people.

What are the two uses for postal combining?

Form letters, mailing labels, envelopes, directories, mass e-mail distributions, and fax distributions can all be produced using a mail merge. . Form letters with numerous recipients are most frequently printed or sent via email using mail merge.

To know more about mail merge visit:

https://brainly.com/question/17731136

#SPJ9

is a short description of an image, added using HTML tags.
The web Accessibility initiative
text-to speech
A screen reader
ALTERNATIVE TEXT

Answers

Answer: HTML stands for Hotmail so it’s a alternative text

Explanation: HTML is actually an alternative text, Hope this helps :D please mark brainliest!

What is one way to increase the bandwidth of a network that uses traditional
wires and cables?
A. Connect more Ethernet switches to the network.
B. Remove the Wi-Fi router.
C. Replace the current cables with fiber optic cables.
D. Install autosensing mechanisms in each wire.

Answers

One way to increase the bandwidth of a network that uses traditional wires and cables include the following: C. Replace the current cables with fiber optic cables.

What is bandwidth?

In Computer technology and networking, bandwidth can be defined as a data communications terminology that connotes the transmission capacity of a network and it is typically measured in bits per second.

What is a fiber optic cable?

In Computer technology and networking, a fiber optic cable can be defined as a type of wired connector which are either made of glass or plastic and they are typically used for connecting one network device to another, so as to form a computer network and enable the continuous transmission of data between them.

Read more on bandwidth here: brainly.com/question/13440200

#SPJ1

Why is it important for an organization to have policies on access privileges, security, disaster planning, and archiving?

Answers

Rules regarding access rights aid in ensuring that only authorised persons have access to sensitive information or important systems. This guards against data breaches for the company.

What guarantees that sensitive and protected data is only accessed by authorised users?

Data privacy or confidentiality refers to the methods used to guarantee that users with the proper authorization only have access to information. This makes sure that only those with permission can view sensitive information.

What kind of access control strategy stops unauthorised users from accessing the network and data through a PC left unattended?

A firewall is a group of connected programmes that guard against unauthorised access to information on a private network. Ensure the firewall is activated or download and install free

To know more about access  visit:-

https://brainly.com/question/24153225

#SPJ1

5) When asked for an insurance quotation, an auto insurance compaty looks up the base rate of insuring a specific make, model and year of car. It then mutiplies the base rate by percentages according to the business rules below to calculate the quote for a customer:
• Drivers over 55 year of age with good driving records pay the 90% of the base rate
• Drivers who are male and under 25 years of age pay 150% of the base rate
• Anyone whoe uses the car for business pay a premium of 120% of what they would pay for personal use only
Example: the base rate for a 2005 Honda Civic might be $500.000. A retired senior with a good driving record would pay $450.000 for coverage to for insurance to drive 2005 Honda Civic. However, if that senior has a business as a messenger for which he uess the car, his rate becomess $540.000
a. Draw a decision table to calculate the quotation for a client
b. Use the decision table above to help design test cases for the test objective: Every driver who requests a quotation is tild the correct rate.
Notes: “Criteria for success” refers to deciding whether application passes the test, not whether the driver gets insurance.

Answers

The decision table is given in the image attached.

What is the insurance  about?

b) Test Cases:

Valid driver, under 25 years old, personal use only.

Valid driver, under 25 years old, business use.

Valid driver, over 55 years old, personal use only.

Valid driver, over 55 years old, business use.

Valid driver, 25 years or older, male, personal use only.

Valid driver, 25 years or older, male, business use.

Valid driver, 25 years or older, female, personal use only.

Valid driver, 25 years or older, female, business use.

Invalid driver (e.g. suspended license).

Invalid car make/model/year.

Therefore,  In the context of the auto insurance example given, the decision table would outline the base rate for a specific make, model and year of car, along with the percentage increase or decrease depending on the driver's age, gender, and whether the car is used for business purposes.

Read more about insurance here:

https://brainly.com/question/25855858

#SPJ1

To what activity is this related?
Name
Company
Email
Phone
Website
Street
City
Province/Region/State
71P code
Name
No Match
No Match
Phone
No Match
Street
City
State
710
4

Answers

It appears that there may be a typo or missing context in your question. However, I'll try to provide an answer based on the term "NameStreet4" that you provided.


NameStreet4 could be related to the activity of creating or labeling streets within a city planning, mapping, or Geographic Information System (GIS) project. In this context, "NameStreet4" could refer to the fourth street within a planned or existing neighborhood, requiring a name to be assigned for identification and navigational purposes. Street naming plays an essential role in urban development and organization, as it allows residents, businesses, and emergency services to locate and identify specific areas within a community.

For such more question on creating

https://brainly.com/question/4185468

#SPJ11

What is text used for ?​

Answers

Text is a online way of communication
Text messaging, or texting, is the act of composing and sending electronic messages, typically consisting of alphabetic and numeric characters, between two or more users of mobile devices, desktops/laptops, or another type of compatible computer.

9. Describe each line of code in the pseudocode version of the generalized getInteger(…) function.

Answers

Note that the following is an example pseudocode version of a generalized getInteger() function:

function getInteger(prompt):

   loop:

       display prompt

       input_string = get_input()

       if is_valid_integer(input_string):

           return convert_to_integer(input_string)

       else:

           display error_message

           continue

What is the explanation for the above response?

Here's a description of each line of code in this pseudocode:

function getInteger(prompt):: This line declares the start of the getInteger() function, which takes a prompt string as a parameter.

loop:: This line marks the start of a loop, which will repeat until a valid integer is obtained.

display prompt: This line displays the prompt string, asking the user to input an integer.

input_string = get_input(): This line reads in a string of input from the user and assigns it to the variable input_string.

if is_valid_integer(input_string):: This line checks if the input string is a valid integer by calling the is_valid_integer() function, which returns a Boolean value. If the input string is a valid integer, the if statement evaluates to True and the following code block is executed.

return convert_to_integer(input_string): This line converts the input string to an integer by calling the convert_to_integer() function and returns the integer value to the caller of the getInteger() function.

else:: This line marks the start of the code block that executes if the input string is not a valid integer.

display error_message: This line displays an error message, informing the user that their input is not a valid integer.

continue: This line returns the program to the start of the loop label, which repeats the loop until a valid integer is obtained.

Learn more about pseudocode at:

https://brainly.com/question/13208346

#SPJ1

List and analyse FIVE websites and explain why the multimedia elements used on these sites were effective.

Answers

Website 1: Airbnb

Airbnb is a popular website for finding vacation rentals, and it uses various multimedia elements to make the user experience more engaging. For example, the website uses high-quality images and videos to showcase its properties. The images are bright and colorful, and they help to make the properties seem more attractive. The videos, on the other hand, provide a virtual tour of the property, which helps users to get a better sense of what it's like to stay there. Overall, the multimedia elements used on Airbnb are effective because they help users to make informed decisions about their vacation rental.

Website 2: Buzzfeed

Buzzfeed is a website that specializes in social news and entertainment, and it uses a range of multimedia elements to keep users engaged. For example, the website uses eye-catching images and videos to grab users' attention. The videos are often short and easy to digest, which makes them perfect for social media sharing. Buzzfeed also uses interactive content like quizzes and polls, which encourage users to engage with the site and share their results on social media. The multimedia elements used on Buzzfeed are effective because they keep users entertained and engaged with the site.

Website 3: Nike

Nike is a well-known athletic apparel company, and its website is designed to showcase its products in a visually appealing way. The website uses high-quality images and videos to showcase its products, and the multimedia elements are designed to be interactive. For example, users can zoom in on product images and view them from different angles. Nike also uses interactive tools like shoe finders and customization options to help users find the perfect product. Overall, the multimedia elements used on Nike's website are effective because they make it easy for users to find and interact with the products they're interested in.

Website 4: The New York Times

The New York Times is a popular news website that uses a variety of multimedia elements to help tell stories in a more engaging way. For example, the website uses high-quality images and videos to accompany news stories. The multimedia elements are often used to provide context or to help users better understand the topic being discussed. The website also uses interactive features like quizzes and timelines to help users learn more about complex topics. The multimedia elements used on The New York Times are effective because they help to make the news more accessible and engaging for users.

Website 5: TED

TED is a popular platform for sharing ideas and inspiring talks, and its website uses a range of multimedia elements to help bring those talks to life. For example, the website uses high-quality videos of the talks themselves, which helps to capture the energy and passion of the speakers. The website also uses interactive features like transcripts and subtitles, which make the talks more accessible to users with different needs. Finally, the website uses social media sharing tools, which encourage users to share talks they find inspiring with their friends and followers. The multimedia elements used on TED's website are effective because they help to share ideas in a way that is engaging and accessible for a wide range of users

1. A newly manufactured computer was bought and ought to be connected to other computer in a warehouse. It was detected that the connection interface uses K – maps to reduce generated data from the new computer. However, the existing system is old and can only handle 5 bit of data at a time. If the new computer generated C’D’B’ + CB’D’ + A’BC + ABC. As the head of technical team, you are required to use a K – map to reduce the data to its min term

a. Draw a K – map and clearly plot all the variable

b. Find all the necessary groupings and produce the min term for the system to be connected to the new computer.

Answers

B because I just finished taking the test

5) When asked for an insurance quotation, an auto insurance compaty looks up the base rate of insuring a specific make, model and year of car. It then mutiplies the base rate by percentages according to the business rules below to calculate the quote for a customer:
• Drivers over 55 year of age with good driving records pay the 90% of the base rate
• Drivers who are male and under 25 years of age pay 150% of the base rate
• Anyone whoe uses the car for business pay a premium of 120% of what they would pay for personal use only
Example: the base rate for a 2005 Honda Civic might be $500.000. A retired senior with a good driving record would pay $450.000 for coverage to for insurance to drive 2005 Honda Civic. However, if that senior has a business as a messenger for which he uess the car, his rate becomess $540.000
a. Draw a decision table to calculate the quotation for a client
b. Use the decision table above to help design test cases for the test objective: Every driver who requests a quotation is tild the correct rate.
Notes: “Criteria for success” refers to deciding whether application passes the test, not whether the driver gets insurance.

Answers

Decision table based on the information will be:

Criteria Age 55+ and good driving record Male and under 25 Business use

Percentage of base rate 90% 150% 120%

Quote Calculation Formula Base Rate x 0.9 Base Rate x 1.5 Base Rate x 1.2

How to explain the information

b. Test Cases:

Test Objective: Verify that a driver over 55 years of age with a good driving record is told the correct rate.

Test Case 1: A 60-year-old driver with a clean driving record requests a quote for a 2005 Honda Civic. Verify that the driver is told the rate of $450.000.

Test Objective: Verify that a male driver under 25 years of age is told the correct rate.

Test Case 2: A 20-year-old male driver requests a quote for a 2005 Honda Civic. Verify that the driver is told the rate of $750.000.

Test Objective: Verify that a driver who uses the car for business is told the correct rate.

Test Case 3: A 40-year-old driver with a clean driving record requests a quote for a 2005 Honda Civic for personal use. Verify that the driver is told the rate of $500.000.

Test Case 4: A 40-year-old driver with a clean driving record requests a quote for a 2005 Honda Civic for business use. Verify that the driver is told the rate of $600.000.

Test Objective: Verify that the correct rate is told for a different make, model and year of car.

Test Case 5: A 30-year-old driver with a clean driving record requests a quote for a 2010 Toyota Corolla for personal use. Verify that the driver is told the correct rate for that car based on the decision table.

Learn more about decision on;

https://brainly.com/question/29097513

#SPJ1

3. What is a Trojan horse?
O A. Antivirus software for your computer
O B. Another name for a hacker
OC. A computer virus that can damage or delete files
O D. Software that eats cookies

Answers

C. A computer virus that can damage and delete files
The correct answer is: C. A computer virus that can damage or delete files. A Trojan horse is a type of malware that disguises itself as a legitimate program. Once inside the computer, it can steal data, damage files, or even take control of the computer.

From the payroll tax of nested if, convert it to compound if with the same policy and conditioni.

Answers

Explanation:

The area of a rectangular land is 720 sq.metre and

perimeter is 108 metre. Out of length or breadth, which one is to

be decreased by what percentage to make it a square? Find it.

survey of 100 college students gave the following data: 8 owned a car (C) 20 owned a motorcycle (M) 48 owned a bicycle (B) 38 owned neither a car nor a motorcycle nor a bicycle No student who owned a car, owned a motorcycle 6 marks] How many students owned a bicycle and either a car or a motorcycle?

Answers

Where the above survey was made,  the number of students who owned a bicycle and either a car or a motorcycle is 30.

What is the explanation for the above response?

Let's denote the number of students who owned a car and a bicycle as C ∩ B, and the number of students who owned a motorcycle and a bicycle as M ∩ B. Then we have:

C = 8 (number of students who owned a car)

M = 20 (number of students who owned a motorcycle)

B = 48 (number of students who owned a bicycle)

C ∪ M ∪ B = 100 (number of students in the survey)

Neither C nor M nor B = 38

C ∩ M = 0 (no student who owned a car also owned a motorcycle)

We can use the formula:

C ∪ M ∪ B = C + M + B - (C ∩ M) - (M ∩ B) - (C ∩ B) + Neither

Plugging in the numbers we have:

100 = 8 + 20 + 48 - 0 - (M ∩ B) - (C ∩ B) + 38

Simplifying:

30 = (M ∩ B) + (C ∩ B)

Therefore, the number of students who owned a bicycle and either a car or a motorcycle is 30.

Learn more about survey at:

https://brainly.com/question/17373064

#SPJ1

Write a program to read Age of N. students then arrange them in ascending order by using function pointer.​

Answers

Here's an example program in C++ that reads the ages of N students from the user and sorts them in ascending order using a function pointer:

The Program

#include <iostream>

#include <algorithm>

using namespace std;

// Function to sort the ages in ascending order

void sort_ages(int *ages, int n, bool (*cmp)(int, int)) {

   for (int i = 0; i < n - 1; i++) {

      for (int j = i + 1; j < n; j++) {

           if (cmp(ages[i], ages[j])) {

               swap(ages[i], ages[j]);

           }

       }

   }

}

// Comparison function to sort in ascending order

bool ascending(int a, int b) {

   return a < b;

}

int main() {

   int n;

   cout << "Enter the number of students: ";

   cin >> n;

   int *ages = new int[n];

   for (int i = 0; i < n; i++) {

       cout << "Enter age of student " << i+1 << ": ";

       cin >> ages[i];

   }

   // Sort the ages in ascending order using function pointer

   sort_ages(ages, n, ascending);

   // Print the sorted ages

   cout << "Sorted ages: ";

   for (int i = 0; i < n; i++) {

       cout << ages[i] << " ";

   }

   cout << endl;

   delete[] ages;

   return 0;

}

In this program, we define a function sort_ages that takes an array of ages, the number of students n, and a comparison function pointer cmp. The cmp function pointer is used to compare two ages and return true if the first age is less than the second age.

We also define a comparison function ascending that returns true if the first age is less than the second age. This function is passed as the cmp argument to sort_ages.

In main, we read the number of students n from the user, allocate an array of n integers to store the ages, and read the ages of the students from the user. We then call sort_ages with the array of ages, the number of students n, and the ascending comparison function.

Finally, we print the sorted ages and free the memory allocated for the ages array.

Read more about programs here:

https://brainly.com/question/26134656

#SPJ1

Can someone help me add service charges onto my python project? (Look at pic below, tyy)

Answers

Sure, here's a Python program that should accomplish what you're looking for:

The Program

# Define a variable to store the initial balance

balance = float(input("Enter initial balance: "))

# Loop through a series of transactions until the user enters "done"

while True:

   # Ask the user for a transaction type

   transaction_type = input("Enter transaction type (deposit or withdrawal), or enter 'done' to finish: ")

   # If the user enters "done", break out of the loop

   if transaction_type == "done":

       break

   # Otherwise, ask the user for the transaction amount

   transaction_amount = float(input("Enter transaction amount: "))

   # If the transaction type is a deposit, add the amount to the balance

   if transaction_type == "deposit":

      balance += transaction_amount

   # If the transaction type is a withdrawal, subtract the amount from the balance

   elif transaction_type == "withdrawal":

       balance -= transaction_amount

   # If the user enters an invalid transaction type, print an error message and continue the loop

   else:

       print("Invalid transaction type. Please enter 'deposit', 'withdrawal', or 'done'.")

# Print the final balance

print("Final balance:", balance)

Here's an example of how this program might run:

Enter initial balance: 1000

Enter transaction type (deposit or withdrawal), or enter 'done' to finish: deposit

Enter transaction amount: 500

Enter transaction type (deposit or withdrawal), or enter 'done' to finish: withdrawal

Enter transaction amount: 200

Enter transaction type (deposit or withdrawal), or enter 'done' to finish: withdrawal

Enter transaction amount: 100

Enter transaction type (deposit or withdrawal), or enter 'done' to finish: done

Final balance: 1200.0

In this example, the initial balance is $1000. The user makes a deposit of $500, then makes two withdrawals of $200 and $100, respectively. The final balance is $1200.

Read more about programs here:

https://brainly.com/question/26134656

#SPJ1

Do you think that Amy should have done anything differently? What would you have done in her situation?

Answers

The excerpt shows that Amy should have done anything differently because talking to a person who is entirely is of taking much risk in her life.

How to explain the excerpt

Sharing or exposing any of her personal information to an unkown is risking her life all ways. So it should be avoided. The person whom she met online is still know where Amy is living.

So Amy should have done some other thing like encouraging herself to find friends at school or may be she can talk with her teacher or school counselor or any of her family members.

Learn more about excerpt on:

https://brainly.com/question/21400963

#SPJ1

What is the purpose of the user manual?

Answers

Answer: to understand the use and functionality of the product

What is an electric pen

Answers

Answer:

Thomas Edison's electric pen, part of a complete outfit for duplicating handwritten documents and drawings, was the first relatively safe electric-motor-driven office appliance produced and sold in the United States.

Explanation:

I need this done ASAP, this is for CPT S 111. THANK YOU!!!

Answers

For the first program, I suggest using a simple database like SQLite to store the information about your favorite movies or video games.

How to depict rye program

Here is an example code in Python to create a database and add some records:

# Create a connection to the database

conn = sqlite3.connect('favorites.db')

# Create a table to store the movie or video game information

conn.execute('''

   CREATE TABLE IF NOT EXISTS favorites (

       id INTEGER PRIMARY KEY AUTOINCREMENT,

       title TEXT,

       visuals INTEGER,

       production_design INTEGER,

       music INTEGER,

       sound_design INTEGER,

       story INTEGER,

       characters INTEGER,

       gameplay_genre TEXT

   )

''')

# Insert some records into the table

conn.execute('''

   INSERT INTO favorites (title, visuals, production_design, music, sound_design, story, characters, gameplay_genre)

   VALUES

       ('The Matrix', 5, 4, 4, 5, 4, 4, 'Action'),

       ('The Last of Us', 5, 5, 5, 5, 5, 5, 'Survival Horror'),

       ('The Lord of the Rings', 5, 5, 5, 5, 5, 5, 'Fantasy'),

       ('Interstellar', 5, 5, 5, 5, 4, 4, 'Sci-Fi'),

       ('The Witcher 3', 5, 5, 5, 5, 5, 5, 'RPG')

''')

# Commit the changes and close the connection

conn.commit()

conn.close()

In this example code, the favorites table has columns for the title of the movie or video game and the scores for each of the seven attributes you mentioned. The id column is an auto-incrementing primary key that uniquely identifies each record. The scores for each attribute are integers from 1 to 5, with 5 being the highest score.

To add more records to the database, you can use the INSERT INTO statement, like in the example code above. Just replace the values in the VALUES clause with the title and scores for each attribute for the new movie or video game.

For the second program, you can write a function that takes a title as input and returns a numerical score based on the attribute scores in the database.

Learn more about program on

https://brainly.com/question/1538272

#SPJ1

as a grade 12 leaner what will be the focus and purpose of my investigation

Answers

As a grade 12 learner, the focus and purpose of your investigation will depend on the requirements of your specific assignment or project. However, generally speaking, the purpose of your investigation will likely be to demonstrate your ability to conduct research, analyze information, and present your findings in a clear and organized manner. Your investigation may be focused on a specific topic or question within a subject area, such as history, science, or literature, or it may be interdisciplinary in nature. You may be asked to use a variety of sources, including academic journals, books, and primary sources, to support your argument or thesis. The goal of your investigation is to showcase your ability to think critically and engage in academic inquiry, which will prepare you for college or university-level work.

Establish the relationship between Computer
and mass
media
while justifying the
Importance of
Computer to
to mass
Communication

Answers

Here are some ways in which computers are important to mass communication:

Production of ContentBroadcasting and Distribution

What is the Computer?

Computers and mass media are closely related in the modern world. Mass communication, which involves the dissemination of information to a large audience through various media channels, such as television, radio, newspapers, magazines, and the internet, heavily relies on computer technology for its functioning.

Therefore, Here are some ways in which computers are important to mass communication:

Production of Content: Computers are widely used in the production of content for mass media, such as writing, editing, designing, and publishing. With the help of computer software, journalists, writers, and editors can create and edit text, images, and videos that are used in various media channels.

Broadcasting and Distribution: Computers are used in broadcasting and distribution of media content.

Read more about Computer here:

https://brainly.com/question/24540334

#SPJ1

What answer would the user need to give for the if statement to run and set playersTurn equal to true?

System.out.println("Would you like to go first? y/n");
String answer = " ";
answer = input.next();

if(answer.equalsIgnoreCase("y")){
playersTurn = true;
}


equals

true

n

y

Answers

For the if statement to run and set playersTurn equal to true, the user must input a string that, when compared case-insensitively, is equal to D. y.

How can the user get the statement to run ?

The code prints out a message asking the user "Would you like to go first? y/n". The user inputs a string value which is stored in the variable answer.

The if statement checks if the user's input answer is equal to "y" ignoring the case (upper or lower case). This is done using the equalsIgnoreCase() method.

If the user provides an input such as "y", "Y", or any combination of upper and lower case letters (e.g., "yY", "Yy", "YY"), the equalsIgnoreCase() method will return true. This sets the variable playersTurn to true, indicating that the player has chosen to go first.

Find out more on statement at https://brainly.com/question/30051380

#SPJ1

I have a masm program that has 2 arrays. They both have 4 values. I do not need inputs since I already have the values provided for me. One array is the points earned in a test and the other array is the points possible. In order to get the average I have to use the formula (points earned/points possible) * 100. I can’t use a loop for this implementation. It has to be a simple masm program. The answers have to be stored in eax and edx

Answers

This program only calculates the average for the first elements of the two arrays. To calculate the averages for the other elements, you would need to adjust the addresses in eax and edx accordingly.

What is an array?
In computer programming, an array is a collection of data elements of the same data type, arranged in a contiguous block of memory and identified by a single name. Each element in the array can be accessed and manipulated by its index or position within the array. Arrays are commonly used to store and manipulate sets of related data, such as a list of numbers or a series of characters in a string.


MASM program that calculates the average score using the provided values in two arrays without using a loop:

.model small

.stack 100h

.data

earned_points dw 80h, 90h, 70h, 85h

possible_points dw 100h, 100h, 80h, 90h

.code

main proc

   mov ax, earned_points

   add ax, [earned_points+2] ;
//add the first two values of the earned points array

   mov bx, possible_points

   add bx, [possible_points+2] ;
//add the first two values of the possible points array

   mul bx ;
//multiply the earned points total by the possible points total

   mov dx, 100h ;
//set the divisor to 100

   div dx ;
//divide the total by 100 to get the average

   mov eax, ax ;
//move the result to eax

   mov edx, 0 ;
//set edx to 0 (since we don't have any remainder)

   ; repeat the process for the second half of the arrays

   mov ax, [earned_points+4]

   add ax, [earned_points+6]

   mov bx, [possible_points+4]

   add bx, [possible_points+6]

   mul bx

   mov dx, 100h

   div dx

   add eax, ax ; add the result to the previous average

   mov eax, eax ; move the final average to eax

   mov edx, 0 ; set edx to 0 (since we don't have any remainder)

   ; exit program

   mov ah, 4ch

   int 21h

main endp

end main


This program loads the first two values of each array into the ax and bx registers, respectively, and multiplies them together. It then divides the result by 100 and stores the quotient in eax. It repeats this process for the second half of the arrays and adds the results to the previous average. Finally, it moves the final average to eax and sets edx to 0.

To know more about MASM visit:
https://brainly.com/question/30763410
#SPJ1

Other Questions
Mario Brothers, a game manufacturer, has a new idea for an adventure game. It can either market the game as a traditional board game or as a PC game, but not both. Consider the following cash flows of the two mutually exclusive projects. Assume the discount rate for both projects is 9 percent.Year Board Game PC0 $ 1,550 $ 3,400 1 760 2,100 2 1,300 1,640 3 280 1,150 a. What is the payback period for each project? (Do not round intermediate calculations and round your answers to 2 decimal places, e.g., 32.16.)b. What is the NPV for each project? (Do not round intermediate calculations and round your answers to 2 decimal places, e.g., 32.16.)c. What is the IRR for each project? (Do not round intermediate calculations and enter your answers as a percent rounded to 2 decimal places, e.g., 32.16.)d. What is the incremental IRR? (Do not round intermediate calculations and enter your answer as a percent rounded to 2 decimal places, e.g., 32.16.)Please note this is for a Finance class for MBA program. 2- Directions: In the blank beside each sentence, indicate whether thesentence is a dangling modifier (DM) or a. misplaced modifier (MM).Rewrite each sentence correctly.1. Mr. John observed a crow looking up from his writing desk. DMMr. John2. The truck on the bridge which is green is mine. MM3. Expecting confusion, our plans were made. DM4. Feeling hot, sweaters were taken off. MM5. I showed my cat to the veterinarian with the fleas. MM6. This typewriter is used by a staff member with a wide carriage. MM7. Swimming out into the sea, the current grew stronger.DM8. Jodi kept all her medicine in the medicine cabinet that had been prescribed to her.DM9. She wore a bicycle helmet on her head that was too large MMreference? a fair coin is tossed until either a head comes up or four tails are obtained. what is the expected number of tosses? Can someone please help me fill this out? 1. _____________ create apps and programs such as for doorbells, garage doors, and lights.2. Computers store information on _____hard drives. Tablets and phones store information on _________ and other devices store information on _______-________ __________. 3. ____________ information is when a computer takes input and does what it says like clicking on the home button.4. Computers take information from the input and then display the _________ on a screen or printer. 5. A collection of code that can be run is called a _____________. 6. When a user enters information to be processed, they do this with a ___________, mouse, or microphone. 7. A plan a programmer using to solve a program or write his code is called the ________________________________.8. The five steps of the SDLC: (know this for your quiz, test and exam)Planning and Analysis Define your ________ and ____________ the scope of the work.1. Design Design your program by writing pseudocode.2. Coding This is where you will write your actual code for your program.3. Testing Identify __defects_________ or errors in your code to make sure your program is running perfectly.4. Maintenance Update and make improvements based on _user feedback__ and fix errors.9. In this course, you will learn a programming language called _____________.10. Coding using a series of steps that are carried out one after another is known as _____________________.11. Main() function All code goes between the def main(): function and the main(). Just like the tag in HTML.12. When programming in Python all codes must be ________________ the same number of spaces. It is best to indent using ______ spaces when indenting and always be consistent.Example: def main(): print (This line is indented.) print(This line is also indented) Main()13. A small segment of code that will provide a specific task is known as a ___________.14. To display text on a screen using Python you will use the _________ function. 15. To display text on a screen the Print() function must include ___________ around the text.Example: print(I Love Movies)16. Everything between the quotation marks is known as a ________ _________ that outputs on the screen.Lesson 2.02: Solving Problems with Algorithms1. A detailed step by step set of instructions used to solve a problem is called an ________________.2. Five Steps of an Algorithm which is in the Design Phase of the Software Development Life Cycle:1. Think of the big __________.2. Consider potential ____________.3. Decide the order in which the instructions need to be ___________.4. Plan which decisions will be made in the ____________________.5. Choose which instructions need to be _________________.3. _______________ is a way of describing a set of instructions in common words and phrases not in Python Code.4. Pseudocode should: Have Comments Include all Steps Make Sense Be Formatted5. Python can do math: Check out these examples: print(5 * 2) or print(10-5) or print(3+2) or print(10/5)Lesson 2.03: Python Variables1. A container that holds information is called a ____________.2. A variable can hold information such as ___________, ______________, ___________, and titles.3. Here is a variable example: Name = John or SecretNumber = 5 or Age = 324. A _________ _________ is the information in quotations in a variable.5. Naming Variables on pg. 2 of Lesson 2.03 is very important. Be sure to review the rules of Naming Variables. This will be on your quizzes, DBA, and exams.6. _______________ is when you assign a variable name that looks like this: movieTitle or newCar. 7. Note: You can not assign a variable a name that is a Keyword. For example, you cant say: 8. A short statement that evaluates their finished project or program is called a _________ ___________ __________.9. 4 Steps of a Post Mortem Review:1. What was the ___________ of your program that you coded?2. How could your program be _________ in the real world?3. What is a __________ you ran into, and how did you ______ it?4. Describe one thing you would do _____________ the next time you write a program. Read the sentence. the brash seagull swooped over the divers before they plunged into the water. where is the best place to insert the participial phrase "synchronizing their watches in the sentence? a. before over b. after divers c. after befored. after water what amount of accounts receivable was written off during the year ended june 30, 2019? what was taylor anderson receivables turnover ratio in 2019? What caused Henry VIII to break with the Catholic Church and seize control of the English church? A. The Protestants pressured King Henry VIII to break away from the Catholic Church. B. The Catholic clergy refused to obey King Henry VIII's Act of Supremacy. C. The pope refused to annul King Henry VIII's marriage to Catherine of Aragon. 5.mr. goracke owns 50 head of cattle on his ranch in southeast nebraska. his cattle have developed round encrusted lesions on their heads and necks. the veterinarian has diagnosed the lesions as dermatophytosis. what is the common name for this condition? mr. goracke would like to turn a profit on these calves and would like to know what the most cost-effective treatment would be, if any. what will the veterinarian most likely tell mr. goracke? The table shows the balance of a money market account over time. Write a function that represents the balance y (in dollars) after t years.Year, t Balance0 $2001 $2302 $264.503 $304.184 $349.805 $402.27The value of a boat is $23,400. It loses 8% of its value every year. Write a function that represents the value y (in dollars) of the boat after t years. a successful quality strategy features which of the following elements? an organizational culture that fosters quality an understanding of the principles of quality engaging employees in the necessary activities to implement quality an organizational culture that fosters quality and engaging employees in the necessary activities to implement quality an organizational culture that fosters quality, an understanding of the principles of quality, and engaging employees in the necessary activities to implement quality A solid cylinder with mass M. radius R, and rotational inertia 1/2MR rolls without slipping down the inclined planeshown above. The cylinder starts from rest at a height H. The inclined plane makes an angle with the horizontal.Express all solutions in terms of M, R, H, theta, and g.a. Determine the translational speed of the cylinder when it reaches the bottom of the inclined plane.b. Show that the acceleration of the center of mass of the cylinder while it is rolling down the inclined plane is (2/3)g sin theta.c. Determine the minimum coefficient of friction between the cylinder and the inclined plane that is required for the cylinder to roll without slipping. What do the United States and the West Virginia constitutions have in common? The bison and elk are both primary consumers in this ecosystem, while the wolves are a predator over time, the bison completely disappeares, give me example of how the ecosystem may respond to this change and explain how this relates to resiliency and biodiversity. which of the following statements is false? a the power of a hypothesis test is a measure of the ability of the test to detect a difference between the estimated value and the true value of a parameter. b as the -level increases, the -level of a hypothesis test decreases. c is the measure of the probability of a type ii error. d the power of a hypothesis test increases as increases. e the power of a hypothesis test does not depend on the sample size. 672.2The internet 24A buffer is 2MiB in size. The lower limit of the buffer is set at 200KiB and the higher limit is set at 1.8MiB.Data is being streamed at 1.5Mbps and the media player is taking data at the rate 600kbps.You may assume a megabit is 1048576bits and a kilobit is 1024bits.a)Explain why the buffer is needed.[2]b)i)Calculate the amount of data stored in the buffer after 2 seconds of streaming and playback.You may assume that the buffer already contains 200KiB of data.[4]ii)By using different time values (such as 4 secs, 6 secs, 8 secs, and so on) determine how long it will take before the buffer reaches its higher limit (1.8MiB).[5]c)Describe how the problem calculated in part b) ii) can be overcome so that a 30-minute video can be watched without frequent pausing of playback 1. What is the volume of a cube with volume 27/64 cubic units a contract that violates state or federal statutory law is: a.illegal, but enforceable. b.legal, but unenforceable. c.illegal and unenforceable. d.legal and enforceable. What is the difference between the normal respiratory system and the deep respiratory system? when a domestic marketer competes against foreign firms to sell products of a similar nature, what type of sales competition is created? group of answer choices brand substitute international competitive social Enumerate the common modes of inheritance?