01_lab
.docx
keyboard_arrow_up
School
Harrisburg University of Science and Technology *
*We aren’t endorsed by this school
Course
500
Subject
Computer Science
Date
Dec 6, 2023
Type
docx
Pages
6
Uploaded by DrSparrow3631 on coursehero.com
Lab 01 R Learning
2022-09-07
Logical Operators:
1.
Use logical operations to get R to agree that “two plus two equals 5” is FALSE.
2
+
2
==
5
## [1] FALSE
2.
Use logical operations to test whether 8 ^ 13 is less than 15 ^ 9.
8
^
13
<
15
^
9
## [1] FALSE
Variables:
3.
Create a variable called potato whose value corresponds to the number of
potatoes you’ve eaten in the last week. Or something equally ridiculous. Print
out the value of potato.
potato
<-
2
potato
## [1] 2
4.
Calculate the square root of potato using the sqrt() function. Print out the
value of potato again to verify that the value of potato hasn’t changed.
sqrt
(potato)
## [1] 1.414214
potato
## [1] 2
5.
Reassign the value of potato to potato * 2. Print out the new value of potato to
verify that it has changed.
potato
<-
potato
*
2
potato
## [1] 4
6.
Try making a character (string) variable and a logical variable . Try creating a
variable with a “missing” value NA. You can call these variables whatever you
would like. Use class(variable name) to make sure they are the right type of
variable.
a
<-
"go!"
b
<-
T
c
<-
NA
class
(a)
## [1] "character"
class
(b)
## [1] "logical"
class
(c)
## [1] "logical"
Vectors:
7.
Create a numeric vector with three elements using c().
num
<-
c
(
1
,
2
,
4
)
8.
Create a character vector with three elements using c().
chr
<-
c
(
"A"
,
"B"
,
"C"
)
9.
Create a numeric vector called age whose elements contain the ages of three
people you know, where the names of each element correspond to the names
of those people.
age
<-
c
(
20
,
25
,
52
)
names
(age)
<-
c
(
"Rose"
,
"Regina"
,
"Holly"
)
10.
Use “indexing by number” to get R to print out the first element of one of the
vectors you created in the last questions.
num[
1
]
## [1] 1
11.
Use logical indexing to return all the ages of all people in age greater than 20.
age[age
>
20
]
## Regina
Holly
##
25
52
12.
Use indexing by name to return the age of one of the people whose ages
you’ve stored in age
age[
c
(
"Rose"
)]
## Rose
##
20
Matrices:
Dataframes:
13.
Load the airquality dataset.
14.
Use the $ method to print out the Wind variable in airquality.
15.
Print out the third element of the Wind variable.
View
(airquality)
airquality
$
Wind
##
[1]
7.4
8.0 12.6 11.5 14.3 14.9
8.6 13.8 20.1
8.6
6.9
9.7
9.2 10.9 13.2
##
[16] 11.5 12.0 18.4 11.5
9.7
9.7 16.6
9.7 12.0 16.6 14.9
8.0 12.0 14.9
5.7
##
[31]
7.4
8.6
9.7 16.1
9.2
8.6 14.3
9.7
6.9 13.8 11.5
10.9
9.2
8.0 13.8
##
[46] 11.5 14.9 20.7
9.2 11.5 10.3
6.3
1.7
4.6
6.3
8.0
8.0 10.3 11.5 14.9
##
[61]
8.0
4.1
9.2
9.2 10.9
4.6 10.9
5.1
6.3
5.7
7.4
8.6 14.3 14.9 14.9
##
[76] 14.3
6.9 10.3
6.3
5.1 11.5
6.9
9.7 11.5
8.6
8.0
8.6 12.0
7.4
7.4
##
[91]
7.4
9.2
6.9 13.8
7.4
6.9
7.4
4.6
4.0 10.3
8.0
8.6 11.5 11.5 11.5
## [106]
9.7 11.5 10.3
6.3
7.4 10.9 10.3 15.5 14.3 12.6
9.7
3.4
8.0
5.7
9.7
## [121]
2.3
6.3
6.3
6.9
5.1
2.8
4.6
7.4 15.5 10.9 10.3
10.9
9.7 14.9 15.5
## [136]
6.3 10.9 11.5
6.9 13.8 10.3 10.3
8.0 12.6
9.2 10.3
10.3 16.6
6.9 13.2
## [151] 14.3
8.0 11.5
airquality
$
Wind[
3
]
## [1] 12.6
16.
Create a new data frame called aq that includes only the first 10 cases. Hint:
typing c(1,2,3,4,5,6,7,8,9,10) is tedious. R allows you to use 1:10 as a
shorthand method!
17.
Use logical indexing to print out all days (ie. cases) in aq where the Ozone
level was higher than 20.
a.
What did the output do with NA values?
18.
Use subset() to do the same thing. Notice the difference in the output.
aq
<-
airquality[
1
:
10
,]
aq[aq
$
Ozone
>
20
,]
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
Flag question
Let A = {1, 2, 3, 4, 5, 6, 7}
Let B = {3, 4, 5, 6, 7, 8, 9}
Let X = 13
Let X=X+|An B|
Let X=X+|A U B|
What is the mystery number X?
Answer:
arrow_forward
assign(self, assignment:Assignment) -> AssignmentResult:
"""
This function is to simulate the process of the student receiving an assignment, then working on the
assignment, then submitting the assignment and finally receiving grade for the assignment. This function will
receive an assignment then a grade should be calculated using the following formula:
grade = 1 - (Student's current energy X Assignment difficulty level). The min grade a student may receive is 0% (0)
After the grade is calculated the student's energy should be decreased by percentage difficulty.
Example if the student has 80% (.8) energy and the assignment is a difficultly level .2 there final energy
should be 64% (.64) = .8 - (.8 * .2). The min energy a student may have is 0% (0)
Finally the grade calculated should be stored internally with in this class so it can be retrieved later.
Then an Assignment Result object should be created with the student's ID, the assignment…
arrow_forward
9 =
; Y= 5
50
18
100
81
Cul culate, Loss,L= mse (7,9)
Note: mse = mean squane ennoto
对5 经
arrow_forward
Equality comparison operator (==) CANNOT be used to compare the values of which of the following type of variables?
O String
o int
o double
O float
arrow_forward
Annotate following code.
def QualityPointCalculator(qualPnts, crdts): if crdts > 0: return qualPnts/crdts return 0def convertGrade(grade): if grade == "A": return 4.00 elif grade == "A-": return 3.70 elif grade == "B+": return 3.30 elif grade == "B": return 3.00 elif grade == "B-": return 2.70 elif grade == "C+": return 2.30 elif grade == "C": return 2.00 elif grade == "C-": return 1.70 elif grade == "D+": return 1.30 elif grade == "D": return 1.00 else: return 0.00
def calcQualPnts(pnts, crdts): return pnts*crdts if __name__ == '__main__': quality_points = [] course_names = [] grades = [] credits = []
final_gpa = 0.0 semester_gpa = 0.0 final_total = 0.0 howMany = 0 print('GRADE & QUALITY NUMERICAL POINTS') choice = input('Would you like to calculate your GPA for a term? Enter Y/N: ') while choice.upper()[0] == 'Y':…
arrow_forward
ACTIVITY # 3
Create a nested =IF formula to calculate the employee bonus for each employee member. Use
this to help you:
• If the total number of customers >= 50 the employee gets 100.00 * no of customers
• f the total number of customers >= 25 they get 50.00 * no of customers
If the number of customers was any less, show "No Bonus"
Here's what the resulting worksheet should look like:
ΕMPLOYEE ΝΑΜΕ
TOTAL CUSTOMER
BONUS
Tom Burnett
15 No Bonus
If no customers >= 50 get 100.00 per customer
Orion Sharp
Monty Hahn
Sidra Emery
Josef Hensley
Katie Rowley
Amani Almond
Avaya Downs
23
1150
If no cusomers is 50-25 get 50.00 per customer
If no customers is less "no bonus"
41
4100
18
900
High Threshold
Med Threshold
Top Bonus
7 No Bonus
35
51
5100
18
100.00
50.00
No Bonus
22
1100
19
950
Med Bonus
Katelin Felix
37
3700
Low Bonus
Antoinette Stout
34
1700
Lower the thresholds and the bonus percentage rates to check that your formula works.
Save this as firstname_lastname_conditional_formulae
arrow_forward
1. Look at the following partial code.
function checker(x) {
var got_an_A = true;
if (x >= 90) {
got_an_A = true;
} else {
got _an_A = false;
if (got_an_A != true) {
document.getElementById("tbx1").value = "Did not get the A";
} else {
document.getElementByld("tbx1").value = "Got the A";
}
a. What will be the value of the textbox with the id: thxl if we have the following function call:
checker(95);
b. What will be the value of the textbox with the id: thxl if we have the following function call:
checker(85);
arrow_forward
Create the following variables that can be used to store values. Use the naming conventions as outlined in the Algorithms/Pseudocode Guidelines document in the course resources section of the course.
1. test grade for student test
2. total of all test grades added together
3. the average for the test grades
Create an assignment statement that sets the value of the variable you created to store the value of all test grades added together to zero. You may refer to Table 6.1 in Chapter 6 for examples.
Create an input statement to input the value for the first test grade for the variable you created.
Create an algorithm that will obtain the test grade for three students, add the test grades together, calculate the average of the test grades, and output the average. Use a count-controlled loop to create the algorithm. Use the information from your answers to questions 3, 4, and 5 in the creation of your algorithm. Also use information and examples from Chapter 6…
arrow_forward
def main(): monthlySales = getSales() printbonus=print_bonus(storeAmount,empAmount)
#This function gets the monthly salesdef getSales(): monthlySales = float(input('Enter the monthly sales $')) monthlySales = getSales() #call to get sales salesIncrease = getIncrease(monthlySales) return monthlySales #This function gets the percent of increase in salesdef getIncrease(monthlySales): storeAmount = storeBonus(monthlySales) salesIncrease = float(input('Enter percent of sales increase: ')) salesIncrease = float(salesIncrease) salesIncrease = salesIncrease / 100 return salesIncrease
#This function determines the storeAmount bonusdef storeBonus(monthlySales): if monthlySales >= 110000: storeAmount = 6000 elif monthlySales >= 100000: storeAmount = 5000 elif monthlySales >= 90000: storeAmount = 4000 elif monthlySales >=80000: storeAmount = 3000 else: storeAmount = 0 return storeAmount
#This function…
arrow_forward
L et D= { s, d, b}, E= { c, k}, G= { a, k }, U={a, b, c, d, k, s}
DUE=
arrow_forward
Following code in C
using random Name Reg no and highschool name
Use switch case in C language to do the following:
Create a restaurant with the name “Your Name - Reg_No – Name of your highschool”
The restaurant should come with the options of delivery and take away and the choice should be displayed as “Delivery – Registration No” and “Takeaway – Name”
Each option should have the same menu and an extra 15% charge be included if a customer wants home delivery
Both menus should have two items that are customizable, such as a burger can have chillies removed, cheese added and extra mayonnaise.
The user should have the option of choosing multiple items with multiple quantity.
Print a bill in the end.
arrow_forward
It's important to know how to best utilize the super keyword.
arrow_forward
Triple the Distance
Use a augmented assignment operator to triple the integer value stored in the variable distance. Assume that distance already has a value.
arrow_forward
$1:When using the test data approach in detecting a problem, the test data must include all possible valid and invalid conditions.$2:Encryption services applied where confidentiality is a stated requirement is an example of systems development and acquisition controls.
A. Both Statements are trueB. Only the first statement is trueC. Only the second statement is trueD. None of the statements are true
arrow_forward
Overview: Create a coin flip game that allows the user to guess whether the coin will be heads or tails. Save the data associated with the flip. Repeat for a total of 10 guesses/flips. Display result summary and details at end.
Technical Requirements:
Participant will guess whether a coin flip will result in Heads or Tails
Computer will "flip" a coin to determine the side it lands using random generator
import random at top of program
result = random.randint(x,x)
The program will display the results: Guess, Flip, Outcome (Match or No Match)
The program will track the results and, when the game is over, display:
Summary
Detailed result of each turn
Use parallel arrays to collect details from each turn that can be displayed as a table when the game is over
Use running totals of each result detail to display at end
arrow_forward
1 dosage = 100
2 time since_last_dose = 7
3 is nighttime = False
4 took something_cross_reactive = False
5
6 #You may modify the lines of code above, but don't move them!
7 #When you Submit your code, we'll change these lines to
8 #assign different values to the variables.
9 #
10 # Let's try to use our mathematical operators and logical
11 #operators together.
12 #
13 #Imagine you've been battling a cold. You're deciding whether
14 #to take cough syrup or not, and if so, how much to take.
15 #
16 #time_since_last_dose represents the number of hours since
17 #you Tast took some cough syrup. For every hour it's been,
18 #you're allowed to have one dose.
19 #
20 #If it's nighttime (is_nighttime), then you may double
21 #your dose since you won't be taking any until morning.
22 #
23 #However, if you've taken something cross-reactive
24 #(took_something_cross_reactive), then you should not take
25 #any cough syrup.
26 #
27 #Write a program that will print how large a dose of cough
28 #syrup…
arrow_forward
def calculate_growth_cycle(plant_name): if(plant_name == "strawberry"): print("### The life cycle of a strawberry ###\nA seed takes 110 days to reach maturity.") elif(plant_name == "cucumber"): print("### The life cycle of a cucumber ###\nA seed takes 76 days to reach maturity.") elif(plant_name == "potato"): print("### The life cycle of a potato ###\nA seed takes 120 days to reach maturity.") else: print('Your plant is available, please try "strawberry", "cucumber" or "potato"')
Plants Growth Cycle
Learning Objectives
In this lab, you will practice:
Defining a function to match the given specifications
Calling the function in your program
Using if statements (can combine them with dictionaries)
Instructions
For every plant, there is a growth cycle. The number of days that it takes starting from being a seed and ending in being a fruit is what is called the growth cycle. Write a function that takes a plant's name as an argument and…
arrow_forward
Payment
=
Principal [rate ((1 + rate)months)]
[(rate + 1)months - 1]
For the formula to compute monthly payment, see Listing 2.9, ComputeLoan.java.
(Financial application: loan amortization schedule) The monthly payment for a
given loan pays the principal and the interest. The monthly interest is computed
by multiplying the monthly interest rate and the balance (the remaining princi-
pal). The principal paid for the month is therefore the monthly payment minus
the monthly interest. Write a program that lets the user enter the loan amount
arrow_forward
1 def is_teenager(age: int) -> bool:
2
""Return True iff age represents a teenager between 13 and 18 inclusive.
3.
4
>>> is_teenager(4)
False
>>> is_teenager(16)
7
True
8
>>> is_teenager (19)
False
10
11
12
if age 18:
16
return False
17
else:
18
return True
19
20
#TODO: complete the new single-line function body in the space below:
arrow_forward
Case 3-1
Ellen is a recent college graduate. She has decided to open a T-Shirt business and would like to create budget worksheet using Microsoft Excel 2016. She need to keep track of her expenses and income for the year.
Ellen has entered all of her monthly expenses. She needs to create a formula that will deduct her monthly expenses from her monthly income. Since her monthly income is the same amount each month, she uses a(n)____ to identify the cell containing the income value.
Group of answer choices
a. relative reference
b. absolute reference
c. mixed reference
d. fixed reference
arrow_forward
Question 03:
Write a simplified sinmulation of Ping-Pong according to the following rules:
• Ranks 0 and 1 participate
• Rank 0 starts with the ball
• The rank with the ball sends it to the other rank
Both ranks count the number of times they get the ball
After counting to 1 million, the rank gives up
• There are no misses or points
arrow_forward
Fill in the blank in the following statement.A store sells an item for 50% more than it's sale price. This means the original price of the item is ______ times larger than the sale price.
arrow_forward
Code Example 4-2
def get_volume (width, height, length=2) :
volume = width * height * length
return volume
def main ():
if
1 = 3
W = 4
h = 5
V = get_volume (1, w, h)
print (v)
name
main ()
ES
O a. 3
O b. 5
O c. 2
O d. 4
_main__":
Refer to Code Example 4-2: What value is passed to the height argument by the
call to the get_volume() function?
arrow_forward
Create an application that finds the greatest common divisor of two positive integers entered by the user.
Console
Greatest Common Divisor Finder
Enter first number: 12
Enter second number: 8
Greatest common divisor: 4
Continue? (y/n): y
Enter first number: 77
Enter second number: 33
Greatest common divisor: 11
Continue? (y/n): y
Enter first number: 441
Enter second number: 252
Greatest common divisor: 63
Continue? (y/n): n
Specifications
The formula for finding the greatest common divisor of two positive integers x and y must follow the Euclidean algorithm as follows:
Subtract x from y repeatedly until y < x.
Swap the values of x and y.
Repeat steps 1 and 2 until x = 0.
y is the greatest common divisor of the two numbers.
You can use one loop for step 1 of the algorithm nested within a second loop for step 3.
Assume that the user will enter valid integers for both numbers.
The application should continue only if the user enters 'y' or 'Y' to continue. Note that if you do…
arrow_forward
Python Returning function
function name: is_prime
parameters: a number n
returns: True if n is prime
behavior: Check the values in the range [2, n) and return False if n is divible by any of them.
function name: bound_0_to_100
parameters:a number grade
returns: the grade with a minimum of 0 and a maximum of 100
behavior: In addition to exceeding 100, sometimes a grade will be so spectacularly bad that it falls below 0. In that case we want to normalize it to 0 so all grades fall into the range [0, 100]. ex: bound_0_to_100(75) returns 75, bound_0_to_100(103) returns 100, and bound_0_to_100(-5) returns 0
function name: bigger
parameters: two values a and b
returns: whichever of the two is greatest
behavior: ex: bigger(3, 9) returns 9
arrow_forward
# Global constant for body mass which is equal to 703
# Create variables and initialize all of them to 0.0
# create variable weight
# create variable height
# create variable BMI
# input the weight from the user.
# input the height from the user.
# Calculate the body mass:
# BMI is equal to weight * body mass divided by
(height * height)
# Display BMI.
# Determine and display weight category if is greater
then 25 you are overweight.
# if is less then 18.5 is underweight otherwise is good
# display all variables
arrow_forward
Java Programming Project
You need to make an exam application in the project. Write the project using JavaFX. Do
not use a database. Accordingly, what is requested must be performed:
1. Adding questions to the question bank: different types of questions should be
added to the question bank. Question types include multiple choice, True/False, fill-in,
and classic type questions. It is mandatory to use inheritance and polymorphism in
writing classes related to questions and in using their objects.
For example, a multiple choice question should have the following information:
a) question text
b) answer options such as a, b, c, d
c) answer
d) points
e) degree of difficulty (such as easy, normal and difficult)
In the upper classes, taking into account the content of other types of questions and
subclasses must be determined which properties should be.
2. Removing a question from a question bank: finding a question that will be deleted
first when removing a question from a question bank it…
arrow_forward
Order the following operators in the order of precedence. 1 is the highest priority and 7 is the lowest
priority.
!=
!
&&
[ Choose ]
[ Choose ]
3
[ Choose ]
4
[ Choose ]
[ Choose ]
6.
[ Choose ]
7
[ Choose ]
>
>
>
>
>
>
+
A
arrow_forward
NEXIGO
prial 5 - Merge COMP1005A
COMP1005-F21 Tutorial 5-B1
N 넷블릭스
ca/d21/le/content/82886/viewContent/2138118/View
Hangman Game
Write a program called hangman.py that will contain problems 1-4.
Problem 1
Write a program called p1.py. Create two global variables, one to store the number of incorrect
guesses and a second to store a word (example: koala).
Page 1 of 6
Write a function called print hangman () that takes no arguments and prints a hangman
corresponding to the number of incorrect guesses (use the global variable).
Example:
x = 4
# number of incorrect guesses
print_hangman ()
/6
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Related Questions
- Flag question Let A = {1, 2, 3, 4, 5, 6, 7} Let B = {3, 4, 5, 6, 7, 8, 9} Let X = 13 Let X=X+|An B| Let X=X+|A U B| What is the mystery number X? Answer:arrow_forwardassign(self, assignment:Assignment) -> AssignmentResult: """ This function is to simulate the process of the student receiving an assignment, then working on the assignment, then submitting the assignment and finally receiving grade for the assignment. This function will receive an assignment then a grade should be calculated using the following formula: grade = 1 - (Student's current energy X Assignment difficulty level). The min grade a student may receive is 0% (0) After the grade is calculated the student's energy should be decreased by percentage difficulty. Example if the student has 80% (.8) energy and the assignment is a difficultly level .2 there final energy should be 64% (.64) = .8 - (.8 * .2). The min energy a student may have is 0% (0) Finally the grade calculated should be stored internally with in this class so it can be retrieved later. Then an Assignment Result object should be created with the student's ID, the assignment…arrow_forward9 = ; Y= 5 50 18 100 81 Cul culate, Loss,L= mse (7,9) Note: mse = mean squane ennoto 对5 经arrow_forward
- Equality comparison operator (==) CANNOT be used to compare the values of which of the following type of variables? O String o int o double O floatarrow_forwardAnnotate following code. def QualityPointCalculator(qualPnts, crdts): if crdts > 0: return qualPnts/crdts return 0def convertGrade(grade): if grade == "A": return 4.00 elif grade == "A-": return 3.70 elif grade == "B+": return 3.30 elif grade == "B": return 3.00 elif grade == "B-": return 2.70 elif grade == "C+": return 2.30 elif grade == "C": return 2.00 elif grade == "C-": return 1.70 elif grade == "D+": return 1.30 elif grade == "D": return 1.00 else: return 0.00 def calcQualPnts(pnts, crdts): return pnts*crdts if __name__ == '__main__': quality_points = [] course_names = [] grades = [] credits = [] final_gpa = 0.0 semester_gpa = 0.0 final_total = 0.0 howMany = 0 print('GRADE & QUALITY NUMERICAL POINTS') choice = input('Would you like to calculate your GPA for a term? Enter Y/N: ') while choice.upper()[0] == 'Y':…arrow_forwardACTIVITY # 3 Create a nested =IF formula to calculate the employee bonus for each employee member. Use this to help you: • If the total number of customers >= 50 the employee gets 100.00 * no of customers • f the total number of customers >= 25 they get 50.00 * no of customers If the number of customers was any less, show "No Bonus" Here's what the resulting worksheet should look like: ΕMPLOYEE ΝΑΜΕ TOTAL CUSTOMER BONUS Tom Burnett 15 No Bonus If no customers >= 50 get 100.00 per customer Orion Sharp Monty Hahn Sidra Emery Josef Hensley Katie Rowley Amani Almond Avaya Downs 23 1150 If no cusomers is 50-25 get 50.00 per customer If no customers is less "no bonus" 41 4100 18 900 High Threshold Med Threshold Top Bonus 7 No Bonus 35 51 5100 18 100.00 50.00 No Bonus 22 1100 19 950 Med Bonus Katelin Felix 37 3700 Low Bonus Antoinette Stout 34 1700 Lower the thresholds and the bonus percentage rates to check that your formula works. Save this as firstname_lastname_conditional_formulaearrow_forward
- 1. Look at the following partial code. function checker(x) { var got_an_A = true; if (x >= 90) { got_an_A = true; } else { got _an_A = false; if (got_an_A != true) { document.getElementById("tbx1").value = "Did not get the A"; } else { document.getElementByld("tbx1").value = "Got the A"; } a. What will be the value of the textbox with the id: thxl if we have the following function call: checker(95); b. What will be the value of the textbox with the id: thxl if we have the following function call: checker(85);arrow_forwardCreate the following variables that can be used to store values. Use the naming conventions as outlined in the Algorithms/Pseudocode Guidelines document in the course resources section of the course. 1. test grade for student test 2. total of all test grades added together 3. the average for the test grades Create an assignment statement that sets the value of the variable you created to store the value of all test grades added together to zero. You may refer to Table 6.1 in Chapter 6 for examples. Create an input statement to input the value for the first test grade for the variable you created. Create an algorithm that will obtain the test grade for three students, add the test grades together, calculate the average of the test grades, and output the average. Use a count-controlled loop to create the algorithm. Use the information from your answers to questions 3, 4, and 5 in the creation of your algorithm. Also use information and examples from Chapter 6…arrow_forwarddef main(): monthlySales = getSales() printbonus=print_bonus(storeAmount,empAmount) #This function gets the monthly salesdef getSales(): monthlySales = float(input('Enter the monthly sales $')) monthlySales = getSales() #call to get sales salesIncrease = getIncrease(monthlySales) return monthlySales #This function gets the percent of increase in salesdef getIncrease(monthlySales): storeAmount = storeBonus(monthlySales) salesIncrease = float(input('Enter percent of sales increase: ')) salesIncrease = float(salesIncrease) salesIncrease = salesIncrease / 100 return salesIncrease #This function determines the storeAmount bonusdef storeBonus(monthlySales): if monthlySales >= 110000: storeAmount = 6000 elif monthlySales >= 100000: storeAmount = 5000 elif monthlySales >= 90000: storeAmount = 4000 elif monthlySales >=80000: storeAmount = 3000 else: storeAmount = 0 return storeAmount #This function…arrow_forward
- L et D= { s, d, b}, E= { c, k}, G= { a, k }, U={a, b, c, d, k, s} DUE=arrow_forwardFollowing code in C using random Name Reg no and highschool name Use switch case in C language to do the following: Create a restaurant with the name “Your Name - Reg_No – Name of your highschool” The restaurant should come with the options of delivery and take away and the choice should be displayed as “Delivery – Registration No” and “Takeaway – Name” Each option should have the same menu and an extra 15% charge be included if a customer wants home delivery Both menus should have two items that are customizable, such as a burger can have chillies removed, cheese added and extra mayonnaise. The user should have the option of choosing multiple items with multiple quantity. Print a bill in the end.arrow_forwardIt's important to know how to best utilize the super keyword.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning