The exact output produ int x-10, y=16, z=12; cout << "The answer:"; if (x
Q: Write a program that computes the tax and tip on a restauran t bill for a patron with a$44.50 meal…
A: #include <stdio.h> int main(){ float meal=44.50,tax,tip,total; tax=(meal/100)*6.75;…
Q: When will the following code snippet prints "MOOSA"? if (x < 1) printf("GERRY"); else if (x < 0)…
A: if else statement is conditional statement . When condition is true if construct is executed…
Q: There are three seating categories at a stadium . For a softball game, Class A seats cost$15, Class…
A: Code: # include <iostream> #include <iomanip> using namespace std; int main() // main…
Q: if (x + y> z) return ceil (y), floor (x); else return ceil (z + x) * y: return x + y + z; What is…
A:
Q: 3. B) What is the value of num when the following code snippet runs successfully? int num = 100;…
A: I give the solution to both with output screenshot I also give the code ,output and code screenshot…
Q: Average acceleration is defined as the change of velocitydivided by the time taken to make the…
A: Program code: //include the header files #include <iostream> using namespace std; //define…
Q: QUESTION 14 To assign a value 1 to variable x, you write O 1 = x; O x = 1, O x = 1, O1 = x; O x ==…
A:
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: Given: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both…
Q: (1) Prompt the user for an automobile service. Output the user's input. (1 pt) Ex: Enter desired…
A: Following program could be made using if else-if ladder.I used java language as language is not…
Q: How many times is the cout statement executed? and predict the output that will be printed to the…
A: Q10. This is a nested for loop. For one iteration of outer loop i, the inner loop will execute one…
Q: tch (m) {case 0: printf(" the number is low\n"); break; case 1:
A: Code: #include <stdio.h> int main (void) { int m; printf ("enter an integer number between…
Q: Which is the correct statement in the following? O if (x = 0) cout << "x is zero"; %3D if (x < y <…
A: Here, I have to choose an option for the above question.
Q: Suppose that num is an int variable. Consider the following C++ code. cin >> num;if (num >=…
A: complete code: #include <iostream> #include<cmath> using namespace std; //main method…
Q: Assume that the variable x is a double value. Which code keeps only 3 digits after the decimal point…
A: Given Assume that the variable x is a double value. Which code keeps only 3 digits after the decimal…
Q: int calculatepower (int x, int y){ if (y > 0) return x* else return 1; int main (){ int num, pwr;…
A: Ans is given in next steps
Q: program so that the user enters the rate of tuition increase for the first year. the rate then…
A: C++ used to answer this question
Q: Given the following function: int strange (int x, int y) if (x > y) return x + y; else return X what…
A: GIVEN:
Q: What does the following code output? int x = 7, y = 10; X -= 32; y *= 4; cout « "y = " « y « " and x…
A: In the C++ program, the code that is in the main() function only has provided; so, for the whole…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: PROGRAM: #Defining the function deriving_cost def driving_cost(driven_miles, miles_per_gallon,…
Q: Puma Filling Station sells gasoline and has a car wash. Fees for the car wash are K40.00 with a…
A: Pseudocode: Input number of liters purchased Input kind of gasoline purchased Input car wash…
Q: Write a pseudo code that calculates the total point earned by a football team over a series of games…
A: Pseudocode: Start the program Declare score, i = 0, counter = 0, sum = 0 Get the input scores from…
Q: The value of a will become 3: int x = 2; x++; int a = (!5 == 5 + 2) ? 3>x ? 3: 5 : 4; cout << x;…
A: 1) In Above code segement we are using multiple conditions in Ternary Operator (?:) 2) We have two…
Q: 4 نقاط This code enters the value of x then calculate the summation of * .the following series s =…
A: Complete program is given below:
Q: Your program will calculate the cost of orders on Amazon.com witha quantity and price, and add…
A: Program in Java: import java.io.*;public class Ordering_System{ public static void main(String…
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: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both…
A: //import the required package import java.util.Scanner; //create a main class public class Gallon {…
Q: The result of the program is #include void main( ) { int x, y, z; x=10; y=5; z-0;…
A: Here, I have to choose an option for the given question.
Q: Suppose that you work for a beverage company. The company wants to know the optimal cost for a…
A: Code import java.util.*;public class Main{ public static void main(String[] args) { int…
Q: 1. Write a simple program to determine the credit card types according to annual income and user…
A: #include <iostream> using namespace std; int main(){ int inc,interest;…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: def driving_cost(driven_miles, miles_per_gallon, dollars_per_gallon): gallons_used =…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: The given program in python is as below: OUTPUT OF THE PROGRAM:
Q: Write a program that computes the body mass index (BMI) of an individual. Your program should begin…
A: Note : Here I have asked for the height in inches and weight in pounds from user. Algorithm : Step…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: Lets see the solution.
Q: Assume that the variable x is a double value. Which code keeps only 4 digits after the decimal point…
A: Assume that the variable x is a double value.
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: 1. As per our guidelines we are supposed to answer only one question. Kindly repost the remaining…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: Answer :
Q: Prompt the user to enter in the three numbers that define a quadratic ??2+??+?=0ax2+bx+c=0, that is…
A: Solution: Given, Prompt the user to enter in the three numbers that define a quadratic. prompt…
Q: 1. Get three exam grades from the user and compute the average of the grades. Ou average of the…
A: ALGORITHM Start Declare 3 variables- (grade1, grade2 and grade3) of float type Declare another…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: As per the given question, driving_cost() function needs to be designed. Input parameters :…
Q: What is the output [x] of the following segment of code if 6 is input by the user when asked to…
A: While doing programming in any programming language, you need to use various variables to store…
Q: #include main() { int x = 5; if (x=7) { if (x=7) printf("Hello"); } printf("Hi"); }
A: here is your answer
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both…
A: Actually, the given program is: Output each floating-point value with two digits after the decimal…
Q: be assigned to the Double variable w when the following statement is executed? w = (x + y)/(x - y) 1…
A: Answer Option d: 2
Q: Q4. Write a program that calculate the person's Body Mass Index (BMI). The BMI is often used to…
A: Given: Write a program that calculates and displays a person’s body mass index (BMI). The…
Q: Given that x = 0, what is the output of this code #include int main (void) { int x; printf…
A: GIVEN: Given that x = 0, what is the output of this code #include <stdio.h> int main (void)…
Q: 3. A fast food restaurant sells the following products: Product Burgersteak Softdrinks Price PhP…
A: I have given C++ code to count the total amount paid by customer to by products.
Q: نقطة واحدة * In the following program, the variable x is #include using namespace std; int main () {…
A: Answer in step 2
Q: Suppose that you work for a beverage company. The company wants to know the optimal cost for a…
A: I have given an answer in step 2.
Step by step
Solved in 2 steps with 1 images
- Dan’s recently announced that he’s teaching n top-secret courses next semester. Instead of enrolling in them through ACORN, students need to email Dan to express their interests. These courses are numbered from 1 to n in some arbitrary order. In particular, if a student named s is interested in taking a course c, they need to sendanemailtoDancontainingthemessagec s.Notethatifastudentis interested in taking multiple courses, they need to send multiple emails, one per course. Uponreceivingamessagec s,Danlooksatthelistofstudentsalreadyenrolledin course c. If there’s already a student on the list whose name is too similar to s, Dan assumes s is the same student and ignores the message. Otherwise, he enrolls s in the course. Dan considers two names too similar if and only if they have the same length and differ in at most one letter (note that “a” and “A” are considered the same letter). For example, “Josh” and “Josh” are too similar. “Sam” and “CaM” are too similar as well. However,…Mr. Johnson has been an independent driver for delivery services (such as Amazon Flex, DoorDash, and Uber Eats). Last month, he bought a fleet of cars and started up a business thatrents them out to other independent drivers. As the business is growing, he wants to hire youto develop a software system that helps manage the renting. The following bullet points arefrom your discussion with Mr. Johnson:• A driver needs to make a reservation for a specific type of car (sedans, SUVs, pick-ups or vans) at least 24 hours before the check-out.• A driver can request an extension for the return date/time and will be granted if thereare no reservations on that vehicle.• The renting charges are different for different types of cars. The charges will beupdated from time to time. A rent that is a week or longer may get a discount.a) Functional requirements : write at least 5 functional requirements of this softwaresystem. For each functional requirement, write the corresponding black-box test…(3) (a) What is Base64? Show at least one application of Base64. (b) What does mount command do in UNIX? Explain with example. [You may use Internet to complete your answers. Proper citation must be provided] (4) Our CPU is currently idle and the current time is labeled time 0. Four processes arrive to the ready queue at the following times and with the following required run time: Process Arrival Time 0 1 2 3 Run Time 9 28 D Simulate the process scheduling and execution under the FCFS, SJF, and SRT scheduling algorithms. Indicate each scheduling decision, and calculate the turnaround time for each process. Also calculate the average turnaround time for each scheduling algorithm. I have started the solution below for FCFS to give an example of the format for your answer.
- Create the AcmePay program for Acme Parts, which runs a small factory and employs workers who are paid one of three hourly rates depending on their shift: first shift, $17 per hour, second shift, $18.50 per hour, third shift, $22 per hour. Each factory worker might work any number of hours per week and any hours greater than 40 are paid at one and one-half times the usual rate. In addition, second-shift and third-shift workers can elect to participate in the retirement plan, for which 3% percent of the worker’s gross pay is deducted from the paychecks. Write the AcmePay program that prompts the user for hours worked and the shift number; if the shift number is 2 or 3, prompt the user to enter the worker’s choice to participate in the retirement plan (1 for "yes", 2 for "no"). Display (1) the hours worked, (2) the shift, (3) the hourly pay rate, (4) the regular pay, (5) overtime pay, (6) the total of regular and overtime pay, (7) the retirement deduction, if any, and (8) the net pay.…23. Banker's algorithm for resource allocation deals with ? a. deadlock prevention b. deadlock aviodance c. deadlock recovery d. circular waitDescription:The project I am working on needs to demonstrate how two processes (parent and child) can communicatethrough a shared memory region, with the child process writing a value to the shared memoryand the parent process reading that value. This is my code and I wont run. Can you help: #include <stdio.h>#include <stdlib.h>#include <sys/types.h>#include <sys/ipc.h>#include <sys/shm.h>#include <unistd.h> #define SHM_SIZE 1024 /* shared memory size */ void error_exit(const char *msg) { perror(msg); exit(EXIT_FAILURE);} int main() { key_t key; int shmid; char *data; // Create a unique key for shared memory if ((key = ftok("shared_memory.c", 'R')) == -1) { error_exit("ftok"); } // Create the shared memory segment if ((shmid = shmget(key, SHM_SIZE, 0644 | IPC_CREAT)) == -1) { error_exit("shmget"); } // Attach the shared memory segment to our data space data = shmat(shmid, (void *)0, 0); if…
- From this selected reference: Bixby, A., B. Downs, and M. Self: “A Scheduling andCapable-to-Promise Application for Swift & Company,” Interfaces, 36(1): 69–86, January–February 2006.https://www.academia.edu/34766673/A_Scheduling_and_Capable-toPromise_Application_for_Swift_and_Company) Summarize the background that led to undertaking this study.You are a scheduling robot assigned to schedule professors and computer science classes that meet M/W/F. There are 5 classes to schedule and 3 professors to teach these classes. Your requirements are: (1) each professor only teaches one class at a time;(2) each class is taught by only one professor; and(3) some professors can only teach some of the classes. You must produce a complete and consistent schedule. You decide to formulate this task as a CSP in which classes are the variables (named C1 through C5) and professors are the domain values (named A, B, and C). After you have solved the CSP, each class (variable) will be assigned one professor (value), and all constraints will be satisfied. The classes (variables) are: • C1, Class 1 - Intro to Programming: meets from 8:00-8:50am• C2, Class 2 - Intro to Artificial Intelligence: meets from 8:30-9:20am• C3, Class 3 - Natural Language Processing: meets from 9:00-9:50am• C4, Class 4 - Computer Vision: meets from 9:00-9:50am• C5, Class 5…My name is Fatima Execute the code using Linux interfacesMake the file name your own, for example (touch seaid.c)Take a picture of the input and output Program 4:1 Orphan process//orphan process#include <stdio.h>#include<unistd.h>int main ( ){int pid ;printf ("I'am the original process with PID %d and PPID %d.\n", getpid ( ), getppid ( ) ) ;pid = fork ( ) ; /* Duplicate. Child and parent continue from here */if ( pid != 0 ) /* pid is non-zero, so I must be the parent */{printf ("I'am the parent process with PID %d and PPID %d.\n", getpid ( ), getppid ( ) ) ;printf ("My child's PID is %d\n", pid ) ;}else /* pid is zero, so I must be the child */{sleep (4) ; /* make sure that the parent terminates first */printf ("I'am the child process with PID %d and PPID %d.\n", getpid ( ), getppid ( ) ) ;}printf ("PID %d terminates.\n", getpid ( ) ) ;}
- 1-Write a Linux Bash shell script to compute the bonus for salespersons who are working at Mercedes Benz dealership who sell the following models: A class - £24,095 - £38,095 (average £31,095) B Class - £28,045 - £38,280 (average £33,162) C Class - £34,670 - £50,405 (average £42,537) E Class - £39,680 - £69,015 (average £54,437) AMG C65 - £78,103 - £81,217 (average £31,095) Each salesperson earns a basic salary of £2,000 per month. However: If he or she achieves £200,000 worth of sales they will earn a bonus of £1,000 per month. If he or she sells more than £300,000 worth of sales they will earn a bonus of £1,500 per month. If he or she sells more than £400,000 worth of sales they will earn a bonus of £2,000 per month. If he or she sells more than £500,000 worth of sales they will earn a bonus of £2,500 per month. If he or she sells more than £650,000 worth of sales they will earn a bonus of £3,000 per month. Design a program which calculates, each salespersons salary per month.…The following assignment requires a spring boot framework. Create a spring boot project. Read the JSON file from online using the given URL : https://hccs-advancejava.s3.amazonaws.com/student_course.json Create two classes, Student & Courses. The following attributes should be captured: Student : first name, email, and gender Course : course no, grade, and credit hour A student may have taken one of more courses as it show in the json file The data read from the URL should be stored in the Student and Course objects Create a search method by name and course no. Calculate the GPA of each student assuming that A=4, B=3,C=2 ....etc. Please upload you solution in Github and provide the URL. Hint - @Autowire and @component are useful dependency injections PreviousNextWhich of the following are true with respect to a mutiprogrammed, time-shared (multi-tasking) environments? (Select all that apply.) Context-switching provides optimal use of the CPU by scheduling ready processes as soon as the CPU is available. Context switching is a zero cost operation. There is better performance when the multiprogramming level is very low. Critical sections and race conditions are a direct result of context switching and programs sharing memory.