Imagine you're working for a fast-food restaurant. get details returns name of the burger and getPrice return the price of the meal. Java
Using Decorator pattern make class BurgerToppings:
-Each topping is an extra $1 and the name provided in the constructor
-getTotalPrice: returns total price of burger + toppings
-getDetails: returns the burger name + name of topping with the word (extra)
Output expected:
Ordering BigMac + extra pickles+ extra cheese
Total price = 6.0
public interface Burger{
double C();
String getDetails();
}
public class BigMac implements Burger{
private String order;
private double price ;
public BigMac() {
this.order= "Big Mac";
this.price = 4.00;
}
@Override
public double getPrice() {
return price;
}
@Override
public String getorder() {
return name;
}
}In: Computer Science
diagnosis
epidemiologic
parameters
antihypertensives
cardiac
lipoprotein
diastolic
interventions
hypertriglyceridemia
hemoglobin
myocardial
demographic
Serum
prediction
Collaborators
hypothesis
territories
hypercholesterolemia
Angiology
myocardial
cholesterol
Hemoglobin
please type thank you.
In: Nursing
Python class
Select a free ebook and download the plain text file (utf8).
Write a program that does the following:
Turn in a .py or Google Colab URL
Dictionaries are not easily sortable since they are not ordered like a list. To sort for this assignment use the following template.
import operator
sorted_dict =
sorted(my_dict.items(),key=operator.itemgetter(1))
In: Computer Science
Write a Python function that takes a list of string as arguments.
When the function is called it should ask the user to make a selection from the options listed in the given list.
The it should get input from the user. Place " >" in front of user input.
if the user doesn't input one of the given choices, then the program should repeatedly ask the user to pick from the list.
Finally, the function should return the word the user selected.
Important Note:
DO NOT USE INPUT AND PRINT INSIDE THE FUNCTION AT
ALL
MAKE THEM OUTSIDE THE FUNCTION PLEASE!
Example:
myList = myFunction(["yes","no","maybe"])
select one of the following please:
yes
no
maybe
# user input example
> could be
select one of the following please:
> perhaps
select one of the following please:
> yes
print(myList)
In: Computer Science
Answer the same problem as the if statement assignment but use the case statement instead.
You are working for a company that offers driver licence training and you have been asked to write a script that asks your clients how old they are.
If he/she is 16 years old display the message "Please visit our company to take the test!"
If he/she is 15 years old display the message "Please take the training with us to learn how to drive!"
If he/she enters any other answer display the message. "Please visit out website to see our services!"
Name your script "case_statement.sh"
Be sure to include the standard header:
# Created by Your Name
# Assignment name
# Date
Do a screenshot of the code and the output. Submit as a single Word document
In: Computer Science
Guided Assignment Problem 3: Call Stack
Your Tasks:
Answer the following questions. Include a function stack chart/diagram for each question to verify your answers.
int example(int n) {
if (n == 0)
return 0;
else
return example(n – 1) + n * n * n;
}
int factorial(int n) {
if (n == 0)
return 1;
else
return (n * factorial(n – 1));
}
In: Computer Science
You are going to create a console based program to keep track of a small business that sells Doodads.
First you will need to create a class Doodad that keeps track of two integers and two Strings.
Next, create a constructor for the Doodad.
Next, add getters and setters for each of the fields (two integers and two Strings).
You need to use Doodad.java (see the starter code)
Inside your main method ask the user to read in the two integers and two Strings. Create a Doodad object and add it to an array of 100 Doodad objects. Allow the user to keep entering in Doodad objects until the user wishes to quit.
Once the user is done entering Doodad objects, show the information about the Doodads they entered.
You will show the first number, followed by a space, followed by the first word.
In: Computer Science
Asks the user "How many parrots do you own?"
2: Reads in that many single word names (one for each parrots) from the user and stores the names in an array.
3: After the user has finished entering names, the program should display the list of all the parrots the user entered.
4: then display the parrots in alphabetical order for part 3. Note: string objects can be compared with the “<” operator, which will determine if a given string is alphabetically less than another string.
You may assume the user will own at most 100 parrots.
c++
"output"
Welcome! How many dogs do you own?
- 4
Ok, enter the names!
> james
> flyingmo
> homer
> kitty
these are the names you entered: flyingmo, homer, james, kitty
In: Computer Science
A survey was taken involving the Spring 2011 Math 1530 students at ETSU. One of the questions asked was "When a person has a disease that cannot be cured, do you think doctors should be allowed by law to end the patient’s life by some painless means if the patient and his/her family request it?”
Here is a table of the responses
|
yes |
no |
don't know |
total |
|
|
female |
236 |
148 |
95 |
479 |
|
male |
222 |
82 |
55 |
359 |
|
total |
458 |
230 |
150 |
838 |
Read the questions carefully. Word order makes a difference.
Question 9 (1 point)
If we pick one Spring 2011 Math 1530 student at random, what is the probability that we get a male student?
PERCENT ANSWER WITH TWO PLACES AFTER THE DECIMAL.
In: Math
You work for a large beverage distribution company and you are managing the "Milk or no Milk" project, which involves a redesign of the milk container for your company. You have several things to consider in order to complete the project successfully. Most generally, you will need to factor both the functional and nonfunctional requirements of the project. Complete a 750-1,000 word proposal that identifies the appropriate stakeholders, defines the requirements for the stakeholders, and states the rationale for the requirements. Also, identify the business requirements across the organization so that the data can be properly validated. Some of the functional requirements to consider are the business rules, industry rules, legal or regulatory requirements, and certification requirements. Some of the nonfunctional requirements to consider are performance (i.e., shelf life), reliability, environmental impact, and ease of use to open.
In: Computer Science