hello! can you please help me with my code? i need to get the same expected output. the instructions are on the photo as well as the expected output here's my code: #include void cheerUp(double*, double*); int main(void) { double engagement_1, engagement_2; printf("Enter engagement level #1: "); scanf("%lf", &engagement_1); printf("Enter engagement level #2: "); scanf("%lf", &engagement_2); cheerUp(&engagement_1, &engagement_2); printf("\n");
Q: Evaluate the following MATLAB expressions by hand and use MATLAB to check the answers 2 / 2 * 3 6 - ...
A: Hey there, I am writing the required solution of the above stated question.Please do find the soluti...
Q: 1. Write a function called removePunct() that takes a string and remove the punctuations from that s...
A: Kindly Note: As per our guidelines we are supposed to answer only first question. Kindly repost othe...
Q: Write a Java program to get a sub string of a given string
A: //Program public class substringexample { public static void main(String args[]) { String ...
Q: Suppose that we are using PDDL to describe facts and actions in a certain world called JUNGLE. In th...
A: The Answer is start from step-2.
Q: What exactly is load balancing? What are the two Load Balancing approaches? Write a paper on Algo...
A: INTRO Load balancing refers to effectively dispensing incoming community visitors across a group of ...
Q: Please answer it in Python In the game of scrabble, each letter is associated with a number of poin...
A: Hey there, I am writing the required solution of the above stated question.Please do find the soluti...
Q: ould i fix this issue ? const express = require('express'); const exphbs = require('express-handleb...
A: Hey there, I am writing the required solution of the above stated question.Please do find the soluti...
Q: Please make this 3d plot in python
A: Your required in the below steps. See below step for code and output.
Q: To show your idea, give an example of how an embedded computer differs from a general-purpose comput...
A: Embedded computers are designed for a specific task. General-purpose computers are designed to perfo...
Q: Q11 Construct DFA equivalent to the .following NFA with empty move
A: Find the answer below. I hope this will meet your requirement...
Q: Write program to send 44H to ports P1 and P2, using (a) their addresses (b) their name
A: Below program to send 44H to ports p1 and p2
Q: Suppose a graph has 6 vertices of degree two, 12 vertices of degree three, and k vertices of degree ...
A: Here in this question we have given that we have 6 vertices of degree 2 12 vertices of degree 3 k ...
Q: 2.15 (Geometry: area of a hexagon) Write a program that prompts the user to enter the side of a hexa...
A: Given: To write a python program to find the area of hexagon.
Q: Give a regular expression for LR, where L is the language L ((ab + b)* b (a + ab)*)
A: For the regular expression given in the question number two L ((ab + b)* b (a + ab)*) we will have L...
Q: 4. Draw the class diagram for items sold in a book store. Every item in the store has a Universal Pr...
A: I attached your answer below.
Q: Let L = {b, aab} and M = {a, b, aa, ab} be languages over the alphabet Σ = {a, b}. Compute the follo...
A: Hey there, I am writing the required solution of the above stated question.Please do find the soluti...
Q: Why is time a dimension that is always included in a data warehouse or a data mart?
A: Introduction: A data warehouse is a method that is necessary for retrieving information from one sou...
Q: A positive whole number n > 2 is prime if no number between 2 and n (inclusive) evenly divides n Wri...
A: Python program: from math import sqrt def prime(n): divisor = 2 found = False max_diviso...
Q: If a transistor on an integrated circuit chip is 2 microns or less in size, then the following is tr...
A: Introduction: Moore's law predicts that electronic gadgets' speed and capacities will double every t...
Q: Explain what big data is and how and why companies are using it these days.
A: Big data: Big data is a set of large data sets or a large volume of data in a structured, semi-struc...
Q: interrupts the starting address 10). In is fixed. A. External interrupt B. Vectored interrupts C. No...
A: Let's see the solution
Q: Colton is working on the data structure that Universal Bank will use to record customer transactions...
A: INTRODUCTION: A queue is a data structure that adheres to the FIFO (First In First Out) principle. A...
Q: E
A: Solution : In below mentioned screenshot explains the BFS search and its final path.
Q: Fredwick wants a program in which he can continuously enter some positive integer values and the pro...
A: C++ Program for above : #include <iostream> using namespace std; int main() { int cn...
Q: Write Java statements (not necessarily complete programs) to achieve indicated task. To read an stri...
A: This problem can be solved using simple charAt method. Here is the solution:
Q: Write a Java program to get a sub string of a given string. Print the original string, and the sub s...
A: Simple Algorithm: Step1:Start. Step2:Take or read String as input. Step3:print SubString from given ...
Q: Mona was writing a new application that would read in a csv file with 5 fields. Shed created 5 paral...
A: Introduction: A file is a collection of characters saved with a name (filename). A text file may be...
Q: What exactly are compound operators?
A: Introduction: Operators with several functions A binary operator and a simple assignment operator ma...
Q: What are the distinctions between security solutions for on-premises data centers and those for the ...
A: Security is important when it comes to data over internet . High security reduces risks of data brea...
Q: The text is encoded with a transposition cipher, as follows: the plaintext is written row-wise acros...
A: As no programing language is mentioned I am solving it using C++
Q: Write Java statements (not necessarily complete programs) to achieve indicated task. To find the ave...
A: Introduction: It is a platform and a programming language. java is known as a high-level programmin...
Q: How many bit strings of length 10 begin with three Os and end with two 1s?
A: there will be 10 strings of length 10 with three 0s at starting and two 1s at end
Q: 3. Suppose we are given a directed acyclic graph G with a unique source s and a unique sink t. A ver...
A: 3) Given an undirected graph G and an edge uv in G. Design an algorithm that runs in 0(|E| + |V|) ti...
Q: 3. Provide the type and hexadecimal representation of the following instruction: sw $t1, 32 ($t2)
A: Written answer provided in step-2.
Q: DMA and cache memory are contrasted.
A: Introduction: DMA is a physical technique that allows data to be transferred from and to memory with...
Q: Do parallel/distributed databases have a distinct advantage over centralized ones?
A: Distributed Database: This type of databases have more than one files and these files are stored on ...
Q: What exactly is Interrupt Processing?
A: Interrupt : In the hardware system, when the jobs are executed one after the other, in intermediat...
Q: Write and execute a PYTHON program to perform the following tasks. Create separate files for each of...
A: Answer the above question are as follows:
Q: P7. Consider the network fragment shown below. x has only two attached neighbors, w and y. w has a m...
A:
Q: Boolean) value of each of the following Boolean expressions, for every possible combination of "inpu...
A: Give a truth table that shows the (Boolean) value of each of the following Boolean expressions, for ...
Q: What is the difference between isochronous and asynchronous networks, and how do they differ?
A: What is the difference between isochronous and asynchronous networks, and how do they differ? ...
Q: Using the example of making a phone call, explain the functionality of Network APIs in a concise man...
A: Introduction: An API defines data structures and subroutine calls for adding new features to an exis...
Q: If a transistor on an integrated circuit chip is 2 microns or less in size, then the following is tr...
A: Introduction: Moore's law predicts that electronic gadgets' speed and capacities will double every t...
Q: 50 40 30 20 10 www
A: I can draw this graph in matlab. Code has been provided matlab software.
Q: In a call centre, what is a typical task done by a level two technician?
A: The level two technician receives the accelerated work order with the description of the problem. Th...
Q: R language Show the specific department has the highest admission on UCB admission dataset available...
A: Hey there, I am writing the required solution of the questin mentioned above. Please do find the sol...
Q: Asymmetric and symmetric encryption techniques each have advantages and disadvantages. What factors ...
A: Intro The symmetric key cryptography as the name suggests is symmetric. What does this mean? This s...
Q: Let L = {01, 10} be a language over Σ = {0, 1}. TRUE or FALSE: (a) 1000 ∈ L* (b) 101001 ∈ L
A: Here in this question we have given a language L = {01, 10} and we have asked weather some string be...
Q: Hydrogenoues seafoor?
A: The Answer is given below step.
Q: write out the four logical forms of the statement: Cats make great pets.(Lable the four forms: State...
A: Here, The original statement is given.
hello! can you please help me with my code? i need to get the same expected output. the instructions are on the photo as well as the expected output
here's my code:
#include<stdio.h>
void cheerUp(double*, double*);
int main(void) {
double engagement_1, engagement_2;
printf("Enter engagement level #1: ");
scanf("%lf", &engagement_1);
printf("Enter engagement level #2: ");
scanf("%lf", &engagement_2);
cheerUp(&engagement_1, &engagement_2);
printf("\n");
printf("Updated engagement level #1: %.2lf\n", engagement_1);
printf("Updated engagement level #2: %.2lf", engagement_2);
return 0;
}
void cheerUp(double *engagement_1, double *engagement_2) {
// TODO: Implement the function definition
}A
Step by step
Solved in 3 steps with 1 images
- Computer Science A system call in an operating system is typically a function call that traps to the kernel. However, there are also library calls that are functions that do not directly trap into the kernel, but may invoke system calls that do. In MINIX, there is a corresponding library call read that always invokes the system call. In UNIX, there are also several other library calls---getc, fgetc, getchar, for example---that also input data. Describe the difference between the MINIX read library call and these functions. How do you think these functions (getc, fgetc, getchar) perform data input? Do they always need to ultimately trap to the kernel? Why or why not?Instruction: Answer question 4 (a,b & c) only (1) Create a C++ project for your assignment 3, with the name format prescribed in the Information section. Add a source file and name it SwapCount. In this file, write the C++ program that will perform the tasks specified in question 2.(2) Declare and implement a function called sortSwapCount that passes three parameters, the array, the size and the reference of proportion, and returns the count. The functiondeclaration is int sortSwapCount(int data[], int size, double& proportion) (i) The function sorts the integers in data[] in ascending order using the bubble sort method. The purpose is to count or determine the number of exchanges (swaps) made by the bubble sort algorithm. (ii) The expected number of sorting swaps (expectedSwapCount) is size * (size - 1) if the array was unsorted. Calculate the proportion of the array status by first converting (or casting) the integers, swapCount and expectedSwapCount into floating-point,…Complete the missing code at ” ” to implement the function with the variables GPIO_PORT_P1, GPIO_PIN0, GPIO_PIN1, INT_PORT1. Int main(void) { ...... GPIO_setAsOutputPin(GPIO_PORT_P1, ); GPIO_setAsInputPinWithPullUpResistor( , ); GPIO_clearInterruptFlag(GPIO_PORT_P1, GPIO_PIN1); GPIO_enableInterupt(GPIO_PORT_P1, ); Interrupt_enableInterrupt( ); ...... } Void PORT1_IRQHandler(void) { Unit32_t status; Status = GPIO_getEnabledInterruptStatus(GPIO_PORT_P1); GPIO_clearInterruptFlag(GPIO_PORT_P1, status); If (status & ) { GPIO_toggleOutputOnPin(GPIO_PORT_P1, ); } } please fill them all in if you can thank you. The picture is what its supposed too look like.
- Using C++ Language Define a function CoordTransform() that transforms its first two input parameters xVal and yVal into two output parameters xValNew and yValNew. The function returns void. The transformation is new = (old + 1) * 2. Ex: If xVal = 3 and yVal = 4, then xValNew is 8 and yValNew is 10. Code: #include <stdio.h> /* Your solution goes here */ int main(void) { int xValNew; int yValNew; int xValUser; int yValUser; scanf("%d", &xValUser); scanf("%d", &yValUser); CoordTransform(xValUser, yValUser, &xValNew, &yValNew); printf("(%d, %d) becomes (%d, %d)\n", xValUser, yValUser, xValNew, yValNew); return 0;}Q2) Write a program to model a simple calculator. Each data line should consist of the nextoperation to be performed from the list below and the right operand. Assume the left operandis the accumulator value (initial value of 0). You need a function scan_data with two outputparameters that returns the operator and right operand scanned from a data line. You need afunction do_next_op that performs the required operation. do_next_op has two inputparameters (the operator and operand) and one input/output parameter (the accumulator).The valid operators are:+ add- subtract* multiply/ divide^ power (raise left operand to power of right operand)q quitYour calculator should display the accumulator value after each operation. A sample run follows.+ 5.0result so far is 5.0^ 2result so far is 25.0/ 2.0result so far is 12.5q 0final result is 12.5Using a 5-bit cell to store integers in 2's complement, what is the smallest integer that can be stored? A. -15 B. -3 C. -16 D.- 31 E. -7 Which statement is true about dynamic typing? A. the binding of a function call and the function definition occurs at compile time B. the binding of a function call and the function definition occurs at run time C. the binding of the type of a variable and the variable name occurs at run time D. the binding of the type of a variable and the variable name occurs at compile time
- When a variable is stored in memory, it is associated with an address. To obtain the address of avariable, the & operator can be used. For example, &a gets the memory address of variable a.Let's try some examples.Write a C program addressOfScalar.c by inserting the code below in the main function. 1 // intialize a char variable, print its address and the next address2 char charvar = 'a';3 printf("address of charvar = %p\n", (void *)(&charvar));4 printf("address of charvar - 1 = %p\n", (void *)(&charvar - 1));5 printf("address of charvar + 1 = %p\n", (void *)(&charvar + 1));67 // intialize an int variable, print its address and the next address8 double doublevar = 1.0;9 printf("address of doublevar = %p\n", (void *)(&doublevar));10 printf("address of doublevar - 1 = %p\n", (void *)(&doublevar - 1));11 printf("address of doublevar + 1 = %p\n", (void *)(&doublevar + 1)); Questions:1) Run the C program, attach a screenshot of the output in the answer…Write a C program that uses a function to calculate Rt. The user will be prompted to enter R1, R2 & R3 which will be passed to the function as parameters, do not use global variables or pointers. The values have no specified range for them but if any of the 3 inputs are less than 0, the function should return 0. The main function should then display the calculated value of Rt with 2 decimal places or an appropriate error message. (Do not use printf or scanf inside the function ... all input/output should be in main) Use appropriate message to prompt the user to enter each value. Three resistors (R1, R2 and R3) are connected so that R1 & R2 are in parallel then in series with R3. Their equivalent resistance (Rt) is calculated using the following equation: Rt=(R1xR2/R1+R2)+R31) Implement a subprogram which takes 4 numbers in the argument registers $a0...$a3, andreturns the largest value and the average in $v0 and $v1 to the calling program. Theprogram must be structured as follows:Subprogram largestAndAverage($a1, $a2, $a3, $a4){ int var0 = $a0, var1 = $a1, var2 = $a2, var3 = $a3; $s0 = getLarger($a1, $a2); $s0 = getLarger($s0, $a3); $v0 = getLarager(s0, $a4); // Largest is in $v0 $v1 = (var0 + var1 + var2 + var3)/ 4; // Aversge is in $v1 return;}Subprogram getLarger($a0, $a1) { $v0 = $a0 if ($a1 > $a0) $v0 = $a1 return;}Note the use of the variables var0...var3. Because the values of $a0 and $a1 (at least) arechanged on the call to getLarger, they will not be available when they are needed to calculatethe average, and must be stored on the stack. To do this problem correctly, you mustcalculate the maximum value using the getLarger subprogram shown here, and it must becalled before the average is calculated. This implies that at a minimum $a0 and $a1…
- . You are given the following information. A function with prototype int mystery(int a, int b, int c, int d); is compiled into assembly code. The body of the code is as follows: leal (%rdi,%rsi,2), %eax leal (%rdx,%rdx,2), %edx addl %edx, %eax leal (%rax,%rcx,4), %eax ret Assume a at rdi, b at rsi, c at rdx, d at rcx, and the return value at eax. Write the C code for mystery function that will have an effect equivalent to the assembly code above. Please dont copy and paste.1) Write a subprogram that accepts 4 values from the argument registers $a0 through $a3 and returns to the caller programme the largest value and the average of $v0 and $v1. The programme must be set up in the following manner: Subprogram largestAndAverage($a1, $a2, $a3, $a4) { int var0 = $a0, var1 = $a1, var2 = $a2, var3 = $a3; $s0 = getLarger($a1, $a2); $s0 = getLarger($s0, $a3); $v0 = getLarager(s0, $a4); // Largest is in $v0 $v1 = (var0 + var1 + var2 + var3)/ 4; // Aversge is in $v1 return;}Subprogram getLarger($a0, $a1) { $v0 = $a0 if ($a1 > $a0) $v0 = $a1 return;}Take note of how var0...var3 are used. The values of $a0 and $a1 (at least) must be placed on the stack since they are not immediately available when needed to compute the average because they are modified during the call to getLarger. You must use the getLarger subprogram displayed above to compute the greatest value for this issue, and it must be called before the average calculation. This indicates that $a0 and…1) Write a subprogram that accepts 4 values from the argument registers $a0 through $a3 and returns to the caller programme the largest value and the average of $v0 and $v1. The programme must be set up in the following manner: Subprogram largestAndAverage($a1, $a2, $a3, $a4) { int var0 = $a0, var1 = $a1, var2 = $a2, var3 = $a3; $s0 = getLarger($a1, $a2); $s0 = getLarger($s0, $a3); $v0 = getLarager(s0, $a4); // Largest is in $v0 $v1 = (var0 + var1 + var2 + var3)/ 4; // Aversge is in $v1 return;}Subprogram getLarger($a0, $a1) { $v0 = $a0 if ($a1 > $a0) $v0 = $a1 return;}Take note of how var0...var3 are used. The values of $a0 and $a1 (at least) must be placed on the stack since they are not immediately available when needed to compute the average because they are modified during the call to getLarger. You must use the getLarger subprogram displayed above to compute the greatest value for this issue, and it must be called before the average calculation. This indicates that $a0 and…