What is the value of grade? grade = Math.abs(-5) * Math.min(-2, -6) а. -30 O b. -10 С. 30 O d. 10
Q: felh (Business: check ISBN-10) Question 1a An ISBN-10 (Intermational Standard Book Number) consists…
A: Take the input as ISBN number Genarate the output It is 10 string length of ISBN number
Q: OUTput [{Jon true 100} {Fred "The Hammer" Smith false 42} {Martha true 37}] name, has_pet, age Jon,…
A: go code for data marshaler using reflection
Q: public static int sum(int low, int high) { if (low > high) { return 0; } if (low % 3 == 0 && low % 2…
A: public static int sum(int low, int high){ int total=0; while(low<high){…
Q: What values are returned by each of the following?a. Math.round(2.3)b. Math.round(2.7)c.…
A: Math.round() method In Java, the Math.round() function is used to round numbers to the nearest…
Q: L DRAW ACTIVI T Y.
A: Here is the answer below:-
Q: int main() { int i, salary[10], range[9]={0, 0, 0, 0, 0, 0, 0, 0, 0}; double gross[10], total[10];…
A: The regular expression (RE) contains the symbol 0 and 1 only. The expression is:…
Q: include int main() { int M; printf("Enter the number of chairs you want to…
A: As your question , i run the code i got two issue in the given code:…
Q: 1 original_total = "5.45" 2 donation = "e.55" 3 4 #You may modify the lines of code above, but don't…
A: Given data, Write some code that will print the customer's total and how much they donated. This…
Q: def kkk(x, y = 10): result 1 while x <= y_and y != 4: -= 2 X += 1 result += x return result What…
A: I have given the value for the argument using which we got output 14.
Q: In code below k = int i=2.j,k; j = i+1; k = i*j; cout<<k;
A: Given Code Snippet: int i=2,j,k; j = i + 1; k = i * j; cout<<k; We have to find…
Q: #include #include struct batsman { char name[20]: p: char* foo(struct batsman *t) strepy(t->name,…
A: Introduction : Given , Code Segment we have to explain its output.
Q: #include <stdio.h>int main(){int d;int s[20],i, j, p, lg=0,m,t=0;char c;printf("Enter number…
A: The function getch() defines under <conio.h> header file, include <conio.h> header file…
Q: Bill Discount Write a Python program that calculate the bill discount based on the customer type…
A: Python Program for above : #get the bill Bill = float(input("Enter your bill: ")) customer =…
Q: #include #include struct batsman char name[20]; }p: char* foo(struct batsman *t) strcpy(t->name,…
A: struct batsman{ char name[20];}p; is a structure which stores string and structure variable…
Q: Specifically, you need to complete: Inputs Birth Date Start Date Retirement Date Initial Investment…
A: Explanation: Include the necessary header files. Create a class to store data members. In the main…
Q: def Rainstatistics () : mList=["January", "February", "March", "April", "May", "June", "July",…
A: Unexpected character occurs in the lines of python codes where the secure code writes mistakenly…
Q: #include #include struct batsman char name[20]; p; char* foo(struct batsman *t) strepy(t->name,…
A: Here first of all we have a structure named batsman with one attribute as a name. Now in the main…
Q: #include <stdio.h>int main(){int d;int s[20],i, r, p, lg=0,m;char c;printf("Enter number of…
A: Add the statement “i+1” in the print statement: printf("salesman %d ",i+1); Add another array to…
Q: * If MyNumber = 6.8, what is the value of ?Int(My Number * 4^2)
A: MATLAB doesn't have the Int() function as described in the question, instead Matlab has int8 and…
Q: Given the following... int j; int sum; double sale[10][7]; Which of the following correctly finds…
A: b. sum = 0; for(j = 0; j < 7; j++) sum = sum + sale[4][j]; will find the sum of…
Q: ost. For example, Your Student ID= 011193127. So, last_three_digits_of_your_ nclude = a, b; t…
A: Answer (1):- Manually tracing the given code:- Here, We will start tracing the whole code from the…
Q: Time Comple master theor fun(int n) { int a = 0; 3; if (n <= 1) %3D return:
A: Time Complexity bymaster theorem:fun(int n) {int a = 0;if (n <= 1)return;for (int i = 1; i <=…
Q: Write a program using if . else statement to display student's bachelor class of graduation based on…
A: The program is written in java.The program will display student’s bachelor class ofgraduation based…
Q: What would be the value of bonus after the following statements are executed? int bonus, sales =…
A: According to the question Output:
Q: The result of the following program is #include #include void main() { char string1 [100]; char…
A: let's see the correct answer of the question
Q: 4) What is returned if factorial(3) is called? a) 0 b) 1 c) 3 d) 6
A: answer: 6 Explanation: factorial can be calculated by product from 1 to n in this case 1*2*3=6 so…
Q: = In code below k int i=2.j.k j = i+1 k = i*j ;cout<<k
A: Here variable i, j and k are integer variable.
Q: sum = 0 i=0 j = 12 var1 = 3 var2 = 3 var3 = 0 while(i var3){ var1 =var1 - i; } else { var3 = var3+…
A: Assembly language: Assembly language is a low level programming language. It is used to directly…
Q: /*A program that calculates the tax due or the refund*/ int main () double inc, tax; int n; printf…
A: The explanation of the code is given below:
Q: char t1[5] = "good"; char t2[5] = "boys"; char t3[15]; strepy (t3, t1); int nl = strlen (tl); int n2…
A: Description. 1- The output will come goodgood. How? 2- char t1[5] = "good"; // t1 is the string…
Q: 8- Evaluate the value of var4 when varl=2.5, var2=3, var3=1 for the following. a) var4 = ++ var3…
A: Please refer below for your reference: Due to company's guidelines we are compelled to answer first…
Q: ude batsman char name[20]; foo(struct batsman *t) strcpy(t->name, "rahul"); return t->name; ain()…
A: Here batsman is a structure with p as it's structure variable. Also foo is a function which returns…
Q: What will the following Code segment print on the screen? String Price = "Fifty Dollars"; String…
A: EXPLANATION: In Java, a string is a collection of char values represented as an object. An array of…
Q: craps.py and die.py (See below). Play the craps game 10 times. Show the output with each win or loss…
A: It is defined as the science concerned with developing and studying methods for collecting,…
Q: What does the following code print out? $cash on hand = 31; $meal = 25; $tax 10; $tip 10; while (…
A: 1) Code in question does below activity It defines below variables and assign them values…
Q: fice of plane 1000$ by default, but discounts are applied to it based on different criteria. 1-…
A: As per the given question, Case 1: If the person is student, then the student gets 20%discount. Case…
Q: What value will be stored in a? 2. Stadium Seating There are three seating categories at a stadium.…
A: The program is written in C++
Q: How many times 'p' value will be printed by running the following code? p = 2 while p <= 10: priht…
A: Explanation: Given: p = 2while p<=10: print("p=",p) p = p+2output:So clearly p will print 5…
Q: secendterm = thirdTerm Next Trace the values of the following variables throughout the loop:…
A: Here the loop will run from i=3 to number ie 7 and it will increment in steps of 1.
Q: QtAnswer the following (you are free to (assign the variables) sqrt(x)+abs(-20) S=…
A: let x=9 y= 5.5
Q: public String toString () Gets a string in the following format: RestaurantBill…
A: Algorithm: Start Create a class called RestaurantBill with cost and service as its attributes…
Q: Enter desired auto service: oil change You entered: Oil change (2) Output the price of the requested…
A: The answer is
Q: A customer want to buy five items. He has only 220.0 OMR with him. The price of the products are…
A: Given: Table is given with item name and price (OMR) as columns. Each item has some price. Goal: We…
Q: #include<stdio.h>#include<stdlib.h> int cent50=0;int cent20=0;int cent10=0;int cent05=0;…
A: All program starts with the main() function, so starting with the main(). Since the amount is an…
Q: Given the following struct: typedef struct { char surname[MAX], name[MAX]; int id; float avg; //…
A: Hi, i have implemented the mostFrequent(student_t s[],int n) and printStudents(student_t s[],int…
Step by step
Solved in 2 steps with 1 images
- What will the following Code segment print on the screen? int P = 30; int Q = 20; System.out.println("Your Total purchase is \n" + (Q*P) +" Dollars");issignment Portion - hand in your wo nce completed "4.2 (Geometry: gneat circle distance) The great circle distance is the distance between two points on the surface of a sphere. Let(x1,y1)and(x2,y2)be the geographical latitude and longitude of two points. The great circle distance between the two points can be computed using the following formula: \[ d=\operatorname{radius} \times \arccos \left(\sin \left(x_{1}\right) \times \sin \left(x_{2}\right)+\cos \left(x_{1}\right) \times \cos \left(x_{2}\right) \times \cos \left(y_{1}-y_{2}\right)\right) \] Write a program that prompts the user to enter the latitude and longitode of two points on the earth in degrees and displays its great circle distance. The average radius of the earth is6,371.01 km. Note you need to convert the degrees into radians using the Math, toRadi ans method since the Java trigonometric methods use radians. The latitude and longitude degrees in the formula are for north and west. Use negative to indicate south and…waht is value version
- In python. Write a program that calculates the BMI (Body Mass Index) of a person, which is used to determine if the ratio of weight and height is appropriate. BMI can be calculated using the following formula: index = weight / height ^ 2 Where the weight must be given in kilograms and the height in meters. The following table shows how the different index ranges are classified: index range Description index <20 LOW WEIGHT 20 <= index <25 NORMAL 25 <= index <30 OVERWEIGHT 30 <= index <40 OBESITY index >= 40 MORBID OBESITYint FindSmallestVal() { int num = 0, min = 0; // reads num until the num > 0 while (num <= 0) { cin >> num; // finds the min value in the min,num min = num < min ? num : min; } // returns min return min; }What is the opposite of greater than?
- # Write python codes here.print("Total E-Customer:", ECustomer.count)c1 = ECustomer("James")c1.setProductDetails("TV",35000,"Air Cooler", 9000)c2 = ECustomer("Mike")c2.setProductDetails("Mobile",20000,"Headphone",1200,"Fridge", 45000)c3 = ECustomer("Sarah")c3.setProductDetails("Headphone", 1200)print("=========================")c1.printDetail()print("=========================")c2.printDetail()print("=========================")c3.printDetail()print("=========================")print("Total E-Customer:", ECustomer.count)Output:Total E-Customer: 0=========================Name: JamesProducts: TV, Air CoolerTotal cost: 44000=========================Name: MikeProducts: Mobile, Headphone, FridgeTotal cost: 66200=========================Name: SarahProducts: HeadphoneTotal cost: 1200=========================Total E-Customer: 3Double any element's value that is less than minValue. Ex: If minValue = 10, then dataPoints = {2, 12, 9, 20} becomes {4, 12, 18, 20}. #include <iostream>using namespace std; int main() {const int NUM_POINTS = 4;int dataPoints[NUM_POINTS];int minValue;int i; cin >> minValue; for (i = 0; i < NUM_POINTS; ++i) {cin >> dataPoints[i];} /* Your solution goes here */ for (i = 0; i < NUM_POINTS; ++i) {cout << dataPoints[i] << " " ;}cout << endl; return 0;} Please help me with this problem using c++.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 =…
- Question: Party budget planning - complex Prompt the user to enter their current budget and the number of people who need to share a meal. You are ordering food from a restaurant that has two menu items: Tacos $4 Empanadas $3 Calculate and print out all the options of meals where the budget is used entirely(where possible) and each person has an equal number of items to eat. They may eat different things, but everyone gets the same number of food items, e.g. 2 tacos or 1 empanada and 1 taco or 2 empanadas. Hints: Here are some things that might help you in your solution. If total items purchased does not equally divide by the number of diners, then abandon that combination. It may help to calculate the max number of empanadas that the budget can buy and also the max number of tacos that the budget could buy. These can be thought of as upper bounds in your loops. In your solution, keep track of items per person Also, keep track of total number of viable solutions, as that might…Question: Party budget planning - complex Prompt the user to enter their current budget and the number of people who need to share a meal. You are ordering food from a restaurant that has two menu items: Tacos $4 Empanadas $3 Calculate and print out all the options of meals where the budget is used entirely(where possible) and each person has an equal number of items to eat. They may eat different things, but everyone gets the same number of food items, e.g. 2 tacos or 1 empanada and 1 taco or 2 empanadas. Hints: Here are some things that might help you in your solution. If total items purchased does not equally divide by the number of diners, then abandon that combination. It may help to calculate the max number of empanadas that the budget can buy and also the max number of tacos that the budget could buy. These can be thought of as upper bounds in your loops. In your solution, keep track of items per person Also, keep track of total number of viable solutions, as that might…for (int value=3; pow (2, value) <=100; value++) cout << pow (2, value) << ": ";