What would be the value of bonus after the following statements are executed?
Q: What is the final value of variable myNum after the following code fragment executes? int myNum 0;…
A: [Please note that here, we are adding a code statement that will display the value of the myNum…
Q: re the following Boolean expressions true or false? (circle instanceof GeometricObject)
A: when you will create a circle class and GeometricObject class and you will create objects for both…
Q: What is the output of the * ?following program
A: Explanation: In the given code, the value of “t” is 11. So, the execution jumps to “case 11”. In…
Q: What could be the output of the following statement? print(random.randrange(1, 8) % 8)
A: Given statement: print(random.randrange(1, 8) % 8)
Q: What will be assigned to x in each of the following statements? x = 8 + 3; x = 8 - 3; x = 8 * 3; x =…
A: GIVEN: What will be assigned to x in each of the following statements? x = 8 + 3; x = 8 - 3; x = 8 *…
Q: What is the output of the following code, assuming variables are declared and header files are all…
A: Program Approach: The header file “<iostream>” is declared that contains all standard…
Q: How do you know if your variable should be declared as an enum type or another data type? Give…
A: The solution to the given question is: When declaring a variable as enum type , you must use the…
Q: what is Return statement ?
A: Return statement: Return statement returns the value to the calling function. It is used to…
Q: What is value of ans after the following code is executed? >> 5 * 5; ; >> ans +
A: ans in matlab is used store the values of the operation. It is a default varible to store the result…
Q: What will be the contents of the variable x after the following statement is executed? x = sqrt(((9…
A: MATLAB stands for matrix laboratory.
Q: What is the result of evaluating the following postfix expression?
A: Firstly, create a stack to store operands or values Scan the expression and do the following- if…
Q: Q4. What is the result of evaluating the following postfix expression? 5 4 6 • 2 Answer:
A: Postfix: The postfix expression is an expression in which operator is written after the operands
Q: What is the output of the ?following program
A: Explanation: Given, “k=5” and “f=9”. The condition “if(f<=k)” fails because, “k” is greater than…
Q: Q: what is the left side of the following expression: x@y1?
A: XOR ⊕ returns 0 for the same input and 1 for different inputs. Given, x ⊕ y ⊕ 1
Q: What is value of ans after the following * ;code is executed? >> 5 * 5; >> ans + 3 Matlab إجابتك
A: by using matlab
Q: What is the final value of variable myNum after the following code fragment executes? int myNum = 0;…
A: From the above given options Option B will be the correct answer Explanation: As we can see in the…
Q: What values will be printed after the following statements execute?
A: Initially, apples=15 bananas=4 pears=10 oranges=18 strawberries=20
Q: Q: what is the left side of the following expression: XOYO1?
A: x ⊕ y x ⊕ y ⊕ 1
Q: Rewrite the following line of code so that it is correct if (name = "Bao")
A: The question asks to correct the statement syntactically.
Q: What is the value of balance after the following code is executed? int balance = 10; while…
A: Step 1:- Program:- #include <iostream>using namespace std;int main(){ int balance = 10;…
Q: What would be the value of bonus after the following statements are executed? int bonus, sales =…
A: According to the question Output:
Q: In this exercise you will use if and else statements to write some code that simulates a gambler who…
A: The given information is: In this exercise you will use if and else statements to write some code…
Q: Consider that there are two variables already declared with values a=10 and b-11. Which of the…
A: Initially, a=10 nd b=11 After completion of program a should be 11 and b should be 10
Q: Evaluate the following expressions and determine the value of all variables, based on the above…
A: The given expressions and the value of allvariables
Q: * What will be the contents of the variable x after the following statement is executed? x =…
A: Answer in step 2
Q: What will the following program display?
A:
Q: . The following statement reates an anonymous type:
A: Anonymous type Anonymous types allow encapsulating a set of values in an object without defining a…
Q: Which of the following statement is false?
A: Solution Option D could be the answer Given option d is false When overriding occurred,the…
Q: Write a statement that outputs variable numObjects. End with a newli
A: Create a list object numObjects which store a list of numbers by taking user’s input. We print all…
Q: What is the value of the following variables after the following actions? int value1, value2,…
A: Increment operator: The unary operator “++” is known as increment operator. “2” types of increment…
Q: What is wrong in the following statement?2 = a
A: Given:- 2 = a To find:- What is wrong with the above statement.
Q: QUESTION 14 What is the output (result) of the following postfix expression? (Response is a numeric…
A: We are given a postifix expression and we have to evaluate the expression. Here the operands are…
Q: What will be the value of result after the following code is executed? #include int fun (x) return…
A: Language is one of the most widely used programming language which has been used to create different…
Q: What is the value of x after the following statements execute? int number = 10; int x =2; number +=…
A: Key concept:- x=number++ here number value is assigned to x first later on number is increased.
Q: What value is printed after the following statements are executed? mylist = ['HELLO'] * 5…
A: Given :- What value is printed after the following statements are executed?mylist = [ 'HELLO '] *…
Q: Q: what is the left side of the following expression: XOY01?
A: X xor Y xor 1
Q: What is the final value of q after all statements are executed? Boolean q; int a = 1; q = (a==3);
A: The Solution for the following question is as follows:
Q: Write an assignment statement that will divide the value in total by the value in count and store…
A: The variable we have are total count mean. The variable in which value is to be stored in present…
Q: The following statement is a prop-
A: Question 1The following statement is a proposition . Lincoln is not the capital of Nebraska.True…
Q: Write a code fragment to prompt the user to enter the age of the visitor for the concert with the…
A: The solution is provided below.
Q: What is the numerical value of the following expression? ('z' 2)
A: The value of the expression ('z'<'x' || 10>2) is as follows:
Q: What is the value of the following expression? true && true
A: There are a lot of operators in any programming language and "&&" operator comes under…
What would be the value of bonus after the following statements are executed?
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- This code when ran asks for job code and then hours worked, but when I put in 20 or 40 hours I get an error... indexerror: Tuple index out of range Its supposed to be for up to 40 hours, no more then that.. how do I fix the tuple range? # Name: Erica Strong # Prog Purpose: This program computes employee weekly pay # Category codes: # C Cashier: $16.50 # S Stocker: $15.75 # J Janitor: $15.75 # M Maintenance: $19.50 import datetime # define pay rates & deduction rates PAY_RATES = (16.50, 15.75, 15.75, 19.50) DEDUCTION_RATES = (0.12, 0.03, 0.062, 0.0145) # define global variables inout = 'C' # C means Cashier, S means Stocker, J means Janitor, M means Maintenance hoursworked= 0 payrates = 0 deductionrates = 0 grosspay = 0 netpay = 0 ############ Define program functions ############ def main(): another_employee = True while another_employee: hours_worked, job_code = get_user_data() gross_pay = perform_calculations(hours_worked, job_code) total_deductions, deductions =…Write a statement to print the data members of InventoryTag. End with newline. Ex: if itemID is 314 and quantityRemaining is 500, print:Inventory ID: 314, Qty: 500 #include <iostream>using namespace std; struct InventoryTag { int itemID; int quantityRemaining;}; int main() { InventoryTag redSweater; cin >> redSweater.itemID; cin >> redSweater.quantityRemaining; /* Your solution goes here */ return 0;}Below is the starting code for this homework assignment #include <stdio.h> //1. struct employees { char name[20]; int ssn[9]; int yearBorn, salary; }; //2. struct employees e = {"kim deen", {1,2,3,4,5,6,7,8,9}, 1998, 35000}; //3. void display(struct employees *e) { printf("%s", e->name); printf(" %d%d%d-%d%d-%d%d%d%d", e->ssn[0],e->ssn[1],e->ssn[2],e->ssn[3],e->ssn[4],e->ssn[5],e->ssn[6],e->ssn[7],e->ssn[8]); printf(" %d", e->yearBorn); printf("\n$%d.", e->salary); } int main() { display(&e); return 0; }
- Using C# in Microsoft Visual Studio create an application that displays the total for a customer’s visit . The application should have the following value-returning methods: OilLubeCharges —Returns the total charges for an oil change and/or a lube job, if any. FlushCharges —Returns the total charges for a radiator flush and/or a transmission flush, if any. MiscCharges —Returns the total charges for an inspection, muf fler replacement, and/or a tire rotation, if any. OtherCharges —Returns the total charges for other services (parts and labor), if any. TaxCharges —Returns the amount of sales tax, if any. Sales tax is 6% and is charged only on parts. If the customer purchases services only, no sales tax is charged. TotalCharges —Returns the total charges. The application should have the following void methods, called when the user clicks the Clear button: ClearOilLube —Clears the check boxes for oil change and lube job. ClearFlushes —Clears the check boxes for radiator flush and…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…CHALLENGE ACTIVITY using C++ 1.6.3: Total cost. A drink costs 2 dollars. A taco costs 4 dollars. Given the number of each, compute total cost and assign totalCost with the result. Ex: 4 drinks and 6 tacos yields totalCost of 32. #include <iostream>using namespace std; int main() { int numDrinks; int numTacos; int totalCost; cin >> numDrinks; cin >> numTacos; cin >>totalCost; cout << numDrinks * 2 + numTacos * 4; cout << "Total cost: " << totalCost << endl; return 0;}
- a java application that allows to enter five townhouse unit costsYou have just started a sales job in adepartment store. Your pay consists of a base salary and a commission. The base salaryis $5,000. The scheme shown below is used to determine the commission rate. Note that this is a graduated rate. The rate for the first $5,000 is at 6%, the next$5000 is at 8%, and the rest is at 10%. If your sales amounts to $25,000, the commissionis 5,000 * 6% + 5,000 * 8% + 15,000 * 10% = 2,200. Your goal is toearn $30,000 a year. Write a program to find the minimum sales you have to generatein order to make $30,000.Assignment Description This program will simulate part of the game of Yahtzee! This is a dice game that involves rolling five dice and scoring points based on what show up on those five dice. The players would record their scores on a score card, and then total them up, and the player with the larger total wins the game. A Yahtzee score card has two portions: The upper portion has spaces for six scores, obtained by adding up all of the 1's, 2's, 3's, etc. The lower portion has special scores for various combinations: Three of a kind -- at least 3 dice are the same number;the score is the sum of all five dice Four of a kind -- at least 4 dice are the same number;the score is the sum of all five dice Small straight -- four consecutive numbers are represented, e.g. 2345;the score is 25 points Large straight -- five consecutive numbers are represented, e.g. 23456;the score is 30 points Full House -- three of one kind, two of another; the score is 30 points Yahtzee! -- five of a kind; the…
- 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…A cashier distributes change using the maximum number of five dollar bills, followed by one dollar bills. For example, 19 yields 3 fives and 4 ones. Write a single statement that assigns the number of one dollar bills to variable numOnes, given amountToChange. Hint: Use the % operator. #include <stdio.h> int main(void) { int amountToChange; int numFives; int numOnes; scanf("%d", &amountToChange); numFives = amountToChange / 5; /* Your solution goes here */ printf("numFives: %d\n", numFives); printf("numOnes: %d\n", numOnes); return 0;java application that will allow a user to keep track of the sales of an employee the user should be presented with an option to enter the employee name and the sales amount continuously prompt the user to enter in a sales amount for an employee until a sentinel value of 0 is entered