C program
Q: What happens if an instruction fails to get approval before writing to VA page 30? In the following ...
A: Given: What happens if an instruction fails to get approval before writing to VA page 30? In the fol...
Q: Operating systems are known to mediate between hardware and users of a system. There are many type...
A:
Q: 32. Which of the following lex variable stores the most recently matched text? O yytext O yyleng О У...
A: Given: Which of the following lex variable stores the most recently matched text?
Q: The exact output produced after executing the following C++ code is intr = 10; void check(int &a, fl...
A: The program is written in C++. Please find the source code and output in the following steps.
Q: Fill in the table below to show the changes in variable first 1, last 1, first 2, last 2, index and ...
A: fisrt1 last1 first2 last2 index [0] [1] [2] [3] [4] [5] [6] [7] 0 3 4 7 1 B J K M D F O T 0 1 2 ...
Q: How do the SPEC CPU tests fix problems with the Whetstone, Dhrystone, and Linpack tests?
A: Introduction: SPEC CPU benchmark addresses Dhrystone, Whetstone, and Linpack benchmark deficiencies:...
Q: Q1) WHAT MIPS INSTRUCTION IS REPRESENTED BY THE FOLLOWING HEX Ox01090010
A: Given: Can you explain this question
Q: Answer properly(editable code , output screenshot) is must Write a C++ program to input electric...
A: Algorithm: 1.Declare main function 2.Declare variables named no_of_units to take units from the user...
Q: What is Waterfall model in software engineering?
A: In this Question, we have to explain about the Waterfall model in software engineering.
Q: comparison between Agile and Iterative
A:
Q: Explain reading and writing binary data in a file ?
A: Answer Reading and writing of Binary data
Q: 3. Given the following q-values, which among the means would be in a separate c XA - Xg = 15-14 = 1 ...
A: 3 Given the following q values,which among the means would be in a separate cluster? a.Means of A an...
Q: ALP 8086 with DOS functions to pr
A: An ALP 8086 with DOS functions to print K to Z, 5 times
Q: if alpha + beta + gamma = pi, show that tan (alpha) + tan (beta) + tan (gamma) = tan (alpha)tan(bet...
A: Answer :
Q: Truth tables simplifies the operations of the various logic gates. Draw a truth table to represent ...
A: Below is the truth table for given expression: As per our company guidelines we are supposed to answ...
Q: Exercise 2.2 Find all odd primes p modulo which both 2 and 3 are quadratic residues.
A:
Q: A TCP connection is established through 10 wireless hops in an acoustic underwater ad hoc network. A...
A: Answer: I have given answered in the handwritten format.
Q: 06. The following vectors have just come in to router C: From B (5, 0, 8, 12, 6, 2); From D: (16, 12...
A: The Answer is
Q: Write detailed java programming language code for hashmap. Take example of hashmap and give output s...
A: Given: Write detailed java programming language code for hashmap. Take the example of hashmap and ...
Q: Based on the database schema that was used in assignment I, answer the following questions: 1. Write...
A: This is the screenshot of script:
Q: ign Design a rest api s
A: System Design a rest api system
Q: A palindrome is a string that reads the same forwards as backwards. Using the Array-based stack, wri...
A: Read word as a user input. Pass the word in a palindrome method that will check if the word is a pal...
Q: borate on the steps involved in obtaining data from the web service API calls from a particular webs...
A: Lets see the solution.
Q: Make A Project . Topic: Restaurant Management System. Cod: In java Requirements: login page of S...
A: In this question we will develop a program in java to develop a Restaurant management system in whic...
Q: Explain in detail how much parallelism (in terms of Instruction level, Thread-level) exists in a Mul...
A: Parallelism is identified on the basis of multiple tasks that are executed at the same time on multi...
Q: Part a. Make a diagram of memory for point one when n == 2. int expo(int x, int n) { int r, t; if (n...
A:
Q: InvalidDateException An event management company needs to keep track of all the events they organiz...
A: Here I have created the class named InvalidDateException that inherits the Exception class and calls...
Q: Interface Devices) How would you design the interface for connecting a dehumidifier to a Wi-Fi netwo...
A: Dehumidifier is used to understand the humidity level is at it's optimum and this is done by monitor...
Q: Differentiate MS Windows, Mac Os and Linux briefly
A: Differences in MS Windows, Mac Os and Linux
Q: The content of theArray need to be merged into tempArray using the function call, merge(theArray, 0,...
A: ALGORITHM:- 1. Take input parameters in the function call. 2. Calculate the size of the subarrays to...
Q: Give one example of a drop-out case, and state how it affects a fully randomized design?
A: According to the given information:- We have to give one example of dropout case that affect a fully...
Q: TOPIC: Inheritance In Python, modify the given code based on the given specifications below. Create...
A: Solution: Given, In Python, modify the given code based on the given specifications below. Creat...
Q: in java language You will write a method that will take a file name (String) as a parameter that i...
A: Java program to find sum of integers in the text file . User input the text file
Q: Differentiate disk cleanup and disk defragmenter
A: Difference between disk cleanup and disk defragmenter
Q: 01. Suppose a router has built up the routing table shown below: Subnet Subnet mask Next hop number ...
A: The Answer is
Q: What happens if an instruction fails to get approval before writing to VA page 30? In the following ...
A: Given: What happens if an instruction fails to get approval before writing to VA page 30? In the fol...
Q: Consider CSMA/CD network running at 512 Mbps over a 1000 meters cable with no repcaters. The signal ...
A: Hi there, Please find your solution below, I hope you find my solution useful and helpful. Thank you...
Q: wRITE HTML CODE FOR INTERMEDIATE OBTAINED MARKS PERCENTAGE GRADE WRTE HTML CODE ENROLLED COURSE...
A: HTML form example it contains the fields INTERMEDIATE OBTAINED MARKS PERCENTAGE GRADE WRTE HTML COD...
Q: Write a C++ program to illustrate Job scheduling using FIFO algorithm.
A: FIFO stands for First in first out, this is also called as FCFS (first come first serve), It first s...
Q: What will be the output of the following program? {i=1; do{ cout << "Way to go!\n" ; i= i+3; }while ...
A: Given: Solve this question with steps please. The subject is managerial programming in c++. What wi...
Q: Table: Employee | Column Name | Type | | id | int | | int | | salary +-- id is the primary key colum...
A: Given, Given Table: Employee Column Name Type id int salary int
Q: Explain why identifying the user group of a web site at an early stage of its design is crucial. Sup...
A: Explain why identifying the user group of a web site at an early stage of its design is crucial. Sup...
Q: What is the most compelling reason to migrate data to the cloud? What is your major security concern...
A: Solution: Given: Cloud is a very advanced and useful technology which is used in almost every applic...
Q: Answer properly Insert the following keys, in the given order, into an initially empty 2-3 tree:...
A: According to the information given:- We have to find the correct post order traversal.
Q: Bob a builder has come to you to build a program for his construction business. He needs to determin...
A: Here we need to take input of the name,length and the breadth of the room and then we need to calcul...
Q: What is the main job of UDP?
A: Answer: In compared to other networking protocols, the UDP protocol's implementation is very straigh...
Q: Why do microcontrollers exist at all? Why not just use a normal processor and add all necessary peri...
A: Defined microcontrollers exist at all, not just use a normal processor and add all necessary periphe...
Q: EXPLAIN THE CODE BELOW PYTHON ,, DBMS def order_det(): sql="select * from order_details" m...
A: Given python program contains order_def function and inside that unction one sql statement is presen...
Q: Exercise 6. Create a dictionary from a Text File: When a program incorporates a large dictionary, th...
A: Answer: For python, I have used Dictionary which is created from a file, Here I have used a Text fil...
Q: Translate the following Scheme function into OCaml/F# (define f (lambda (a b) (let ((c 5)) (lambda (...
A: -F# Code------------------------ open System let f a b = let returnFunc c = a + b ...
I am trying to write a C program to find the percentage of marks obtained when the user enters marks scored, but the output is always coming 0.000 Please help me by telling what is the error in my code.
Code:
#include <stdio.h>
int main()
{
int totalMarks = 500;
int marksScored;
scanf("%d",&marksScored);
float percent = (marksScored*100)/totalMarks;
printf("Percent = %.2f",percent);
return 0;
}
Step by step
Solved in 3 steps with 2 images
- C++ - When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. This can be done by normalizing to values between 0 and 1, or throwing away outliers. For this program, adjust the values by subtracting the smallest value from all the values. The input begins with an integer indicating the number of integers that follow. Ex: If the input is: 5 30 50 10 70 65 the output is: 20 40 0 60 55 The 5 indicates that there are five values in the list, namely 30, 50, 10, 70, and 65. 10 is the smallest value in the list, so is subtracted from each value in the list. For coding simplicity, follow every output value by a space, including the last one.C++ Programming Language: Enhance the code given by outputting: The largest number of the sequence a0 ,a1 ,a2 , ..., ak. The position of the largest number Test your program for the following values of x: 75, 111, 678, 732, 873, 2048, and 65535. Example: "For example, for the input sequence: 75, 226, 113, 340, 170, 85, 256, 128, 64, 32, 16, 8, 4, 2, 1, the program output should contain the following: The largest number of the sequence is 340 The position of the largest number is 4" Code Given: #include <iostream> #include <iomanip> using namespace std; int main() { long x; int count; long a_n; cout << "Enter a nonnegative integer: "; cin >> x; cout << endl; count = 0; a_n = x; cout << a_n << ", "; while (a_n !=1) { if (a_n %2==0) a_n = a_n / 2; else a_n = 3 * a_n + 1; count++; cout << a_n <<", "; } cout << endl; cout << "The integer k such that a_k = 1 is " << count << endl; return0; }c programing language A store asks you to write a C program to make cash payment easier for cashiers. Write a Cprogram that divides the amount of money entered by the cashier into 200 TL, 100 TL, 50 TL,20 TL, 10 TL, 5 TL, and 1 TL banknotes and shows the number of each banknote. Your programshould have an output as given below.
- Use C++ Programing language. Write a program that computes and displays the charges for a patient’s hospital stay. First, the program should ask if the patient was admitted as an inpatient or an outpatient. If the patient was an inpatient, the following data should be entered: The number of days spent in the hospital The daily rate Charges for hospital services (lab tests, etc.) Hospital medication charges If the patient was an outpatient, the following data should be entered: Charges for hospital services (lab tests, etc.) Hospital medication charges Use a single, separate function to validate that no input is less than zero. If it is, it should be reentered before being returned. Once the required data has been input and validated, the program should use two overloaded functions to calculate the total charges. One of the functions should accept arguments for the inpatient data, while the other function accepts arguments for outpatient data. Both functions should return the…using c++ Write a program that computes and displays the charges for a patient's hospital stay. First, the program should ask if the patient was admitted as an in-patient or an out-patient. If the patient was an in-patient, the following data should be entered: The number of days spent in the hospital The daily rate Hospital medication charges Charges for hospital services (lab test, etc.) The program should ask for the following data if the patient was an out-patient: Charges for the hospital services (lab test, etc.) Hospital medication charges The program should use two functions to calculate the total charges. One of the functions should accept arguments for the in-patient data, while the other function accepts arguments for out-patient information. Both functions should return the total charges.In Python Objectives To be able to get input from the user on one line, modify the data type, and perform mathematical operations on the data. Description Statistics are often calculated with varying amounts of input data. Write a program that takes any number of integers on a single line as input, and output the average (as a float with 2 decimal points) and the max. When you output the average, you must use the format() method or you will not pass one of the test cases. Pseudocode: Get the string of numbers from the user Split the string into tokens Loop through the tokens Turn each token from a string to an integer Add the integer to a list of integers Calculate the average of the list of integers Calculate the maximum of the list of integers Version 1 Create the code that will prompt the user for the data, split the data into tokens in a list, and verify the list is populated by displaying it to the screen. Version 2 Loop through the tokens and verify the looping is correct by…
- Using c++ Write a program that computes and displays the charges for a patient’s hospital stay. First, the program should ask if the patient was admitted as an inpatient or an outpatient. If the patient was an inpatient, the following data should be entered: The number of days spent in the hospital The daily rate Charges for hospital services (lab tests, etc.) Hospital medication charges If the patient was an outpatient, the following data should be entered: Charges for hospital services (lab tests, etc.) Hospital medication charges Use a single, separate function to validate that no input is less than zero. If it is, it should be reentered before being returned. Once the required data has been input and validated, the program should use two overloaded functions to calculate the total charges. One of the functions should accept arguments for the inpatient data, while the other function accepts arguments for outpatient data. Both functions should return the total chargesPrograming Language: C++ Your time machine is capable of going forward in time up to 24 hours. The machine is configured to jump ahead in minutes. To enter the proper number of minutes into your machine, you would like a program that can take a start time (in hours, minutes, and a Boolean indicating AM or PM) and a future time (in hours, minutes, and a Boolean indicating AM or PM) and calculate the difference in minutes between the start and future time. A time is specified in your program with three variables: int hours, minutes; bool isAM; // You can also use a char, i.e. A or P for example, to represent 11:50 PM, you would store: hours = 11,minutes = 50, isAM = false or if using a char, hours = 11,minutes = 50, isAM = 'A' This means that you need six variables to store a start and future time. Write a program that allows the user to enter a start time and a future time. Include a function named computeDifference that takes the six variables as parameters that represent the start…Use C++ Programming int exemplary(int score) Returns how many entries in the scoreboard are greater than or equal to the given score. Initial code below virtual int exemplary(int score) { return 0; //you may or may not change this }
- A Moment that arise from a load is calculated by means of the applied load multiplied by the distance between the applied load and support. For instance: In the figure below, a load of 10 kN is applied at 4m away from point A. In this case, the moment at the point A will be 10 kN X 4 m = 40 kN.m 10 KN 4 m A 5 m Write a program in C or Python that calculates the moment at the support (point A) depending on the amount of the load applied and the distance of the load off the point A, which will be entered by user. (Other programming languages will not be accepted). Note: the load can be applied within the length of the beam. Examples: Please enter the distance of the load away from point A (0 - 5m): 4 Please enter amount of load: 10 The moment applied to point A is 40 kN.m Process finished with exit code 0 Please enter the distance of the load away from point A (0 - 5m): 6 Please enter amount of load: 5 the distance should be between 0-5 m Process finished with exit code 0 Please enter…Fundamentals of Programming in C Language Write the value of each of the following expressions, using the following data declarations: double m = 17.5; int y = 9; 1. (m > 12.0) && (y / 2 <= 4) 2. (y % 3 != 0) 3. (m < 2 * y) 4. (2 == 3) || (m - 16 >= 0)c++ A palindrome is a word or a phrase that is the same when read both forward and backward. Examples are: "bob," "sees," or "never odd or even" (ignoring spaces). Write a program whose input is a word or phrase, and outputs whether the input is a palindrome. If the input is bob, the output is: bob is a palindrome If the input is bobby, the output is: bobby is not a palindrome Hint: Start by just handling single-word input, and submit for grading. Once passing one single-word test cases, extend the program to handle phrases. If the input is a phrase, remove or ignore spaces. 356110.1926120.qx3zqy7