2) int a-49, b-7, c; if (a>5 && b<5) c=a*2%b;
Q: A small code that returns the average earning of all employees
A: In the program, a function named average is created to return the average earning of all employees.…
Q: 5.18 LAB: Count characters - functions Write a program whose input is a character and a string, and…
A: Create a 2 variable of type character and string Then take user input in main method After that…
Q: 2.2 what is the value of S1, S2 and S3 where S1, S2 and S3 type is float and each one is equal the…
A: Given: x=4, y=10, w=-10 ceil() = returns the nearest integer greater than the argument passed sqrt()…
Q: Q4, a mechanical pump whose rated speed is (Sm=15 cfm) is connected by a pipe and valve to a vacuum…
A: Please refer to the following steps for the complete solution to the problem above.
Q: C++ Code Only: One day, Fred and his N friends were playing a card game in which each player throws…
A: We have to write a code to maximize the sum which we get on the front cards, keeping in mind that we…
Q: 1- int a = 1, b = 0; %3D if (a -1) {a = b = 23 ;} cout << x << " "<y< endl; 2- int x; for (x = 1;…
A: I think the x and y in the first program may be a and b. If so, here is the output and the correct…
Q: Assume that a, b, c are numbers. Return 'increasing' if they are in increasing order, 'decreasing'…
A: We have to write a program that can enter a number a,b,c and Return 'increasing' if they are in…
Q: 4. If myAge, a, and b are all int variables, what are their values after myAge = 39; a = myAge++; b…
A: ++myAge returns the worth of an after it has been increased. It is a pre-increase administrator…
Q: Srikanth is a school student. He studies in class 8th. One day his Math’s teacher came to the class…
A: Please find the answer below :
Q: c++ You are implementing a function that checks the value of the following variable of type char…
A: Function to implement bitwise operator without IFs sand switches
Q: The nuclear powerplant at Threeyedfish will automatically run a program to print a warning message…
A: #function to print message def reactorUnstableMessage(): #printing message three times using for…
Q: 24 / A mechanical pump whose speed is (Sm = 15 cfm) is connected by a pipe and valve to a vacuum…
A: C++ CODE #include <iostream>using namespace std; int main() { // your code goes here float…
Q: 5) int x; x=10,20,30; cout<<x<<endl;
A: Coded using C++.
Q: A bag or cookies holds 50 cookies. The calorie information on the bag claims that there are 10…
A: Answering first question as per the guidelines. The problem is based on the basics of functions in…
Q: n C++ 1. Declare, define, and test the following function to check for order by name: bool…
A: a) Declare, define, and test the following function to check for order by name:bool…
Q: Each function should accept two integer parameters indicating the minimum and maximum X value to be…
A: Since I am not supposed to use loops, i am using recursive functions to print the given pattern.…
Q: C++ PROBLEM. PASTE INDENTED CODE HERE void e(int x, int y) { if(y<2) { cout << x << " "; return; }…
A: PROGRAM CODE: #include <iostream> using namespace std;void e(int x, int y) {if(y<2) {cout…
Q: 4. In the following enum enum E { CO=0, C1=1, C2=2}; Overload the + operator to do the following…
A: #include<iostream>using namespace std; //Enum declarationenum E {C0=0 , C1=1 , C2=2};…
Q: A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to…
A: def is_leap_year(user_year): if user_year % 100 == 0: #First check if its a century or not…
Q: Consider the statement int val[2] [4] = { 1, 2, 3, 4, 5, 6, 7, 8} ; 4 will be the value of A.…
A: We are given a 2-d array and we are going to find out how an element 4 which is present in the array…
Q: Qno. 1 () Construct a program where implicit conversion would have been done. ii) Construct a…
A: i) #include <iostream> using namespace std; int main() { //declaring int variable int…
Q: 10.9 (Using Unions) Create union floatingPoint with members float f, double d and long double x.…
A: The program is written in c
Q: 8: PGandE.cpp) Consider a gas and electric bill that sets two levels of use as follows: Gas Electric…
A: Coded using C++.
Q: # Define your function here name user values, upper threshold get user_values()…
A: The main logic to print all numbers less than upper_threshold, for i in user_values: if…
Q: This error occurs when a value is not available to a .function or formula #REF!. O #NULL!. O #N/A O
A: Given, This error occurs when a value is not available to a function or formula #REF! #NULL! #N/A
Q: y = floor( x + 0.5 ); rounds the number x to the nearest integer and assigns the result to y. use…
A: C++ code for above : #include <iostream>#include <math.h>using namespace std; int…
Q: Use C++: Develop a Tic Tac Toe game that will match a player against the computer. Do’s: Use a…
A: As per question we use only Program must use: functions loops branching string functions
Q: Write a code im c++ to overload area() function that can find the area of circle, rectangle ,…
A: Formula to calculate the area of the circle of radius, r: area=3.0×π×radius×radius Formula to…
Q: Write a program that takes in a year and determines whether that year is a leap year. Ex: If the…
A: Program description: C program that prompt user to enter the year value. Then pass the year value to…
Q: 7. [10] (Display Pattern) Write a C++ function called pattern that displays a pattern of stars and…
A: In this program, you need to write C++ function called pattern and also need to write main function…
Q: Write a program that takes in a year and determines whether that year is a leap year.
A: /******************************************************************************…
Q: d. Assume i, j and k are integer variables with i=3 and j=4. Determine the value of k for each of…
A: first lets understand operators used in given statements:j++ : post increment operator:means value…
Q: Write a function that returns the number of days in a year using the following header:def…
A: //********C++ class Calendar program to calculate *******////****************number of years, months…
Q: c++ PLEASE TRACE THE FUNCTION Given the code: void d(int n) { if(n<2) { cout << n << "…
A: Function: When we first time called d(12) it will print 12 and then call d(12/3) i.e d(4) when…
Q: Create union floatingPoint with members float f, double dand long double x. Write a program that…
A: First we create the union with three members. Then we will input the values of these members. Then…
Q: 21. The five line bellow are used to determine the profit or loss of a sale based on the buying cost…
A: Given:
Q: Write a function that returns the sum of all the integer numbers dividable by 3 that are smaller…
A: #defined Sum3 function for calculating sum of numbers which are divisible by 3. def Sum3(limit):…
Q: int x=22, y=17; if((x>30 || y<2)) cout<<"BAHRAIN"; else cout<<"MANAMA"; A MANAMA B BAHRAINMANAMA C.…
A: The given code is: int x=22, y=17 here x is not greater than 30 so first condition is false. y…
Q: Assignment Write a program in C that converts temperatures between Fahrenheit, Celsius, and Kelvin.…
A: Below is the required code in C language. Program Approach: Including necessary header files for…
Q: Write C++ statement(s) to allocate space for 10 doubles (using dynamic memory allocation).
A: new is used to allocate space dynamically. syntax: new data-type; statement to allocate space for…
Q: 10-define the function aa(int x,int y) int aa(int x,int y) int aa() void (int x,int y)
A: Function syntax is Return_type function_name (parameter)
Q: Develop a Tic Tac Toe game that will match a player against the computer.
A: #include <iostream>#include <string>#include <time.h>#include <random>using…
Q: 8: PGandE.cpp) Consider a gas and electric bill that sets two levels of use as follows: Gas 10.1…
A: The main object of the program is to read the starting reading gas consumption and ending reading…
Q: int a=4, b=9,x; //Type the ternary condition here cout<<"x="<<x<<endl;
A: 1- The conditional-ternary operator is the simplest programming language operator that takes 3…
Q: VBA EXCEL PROBLEM: Create a function that receives two positive integers a and b and returns ab.
A: The below program uses loop to count ab. In loop we will multiply a to itself, b times. Exit.
Q: Part 1– Substance Test Table 1 below shows the normal boiling points of several substances. Write a…
A: C program to find the whether substance belong to the list
Q: Sub: Data structure Consider the following 'C' routine int DO ( int a[ ], int /b, int ub) { int…
A: The program has two parts: Calling function: It generally pass the value(s) to the called function…
Q: If, A = {3, 5, 7, 9} B = {2, 4, 6, 8, 10} C = {12, 14, 18, 20, 24} D = {21, 26, 31, 36} A.…
A: Given sets are: A = {3, 5, 7, 9} B = {2, 4, 6, 8, 10} C = {12, 14, 18, 20, 24} D = {21, 26, 31, 36}…
Q: Refer to the code segment in Program (A), Identify the value of temp. Program (A) int a[6] =…
A: Below is the complete C++ program to implement the given block of code also the code is well…
Step by step
Solved in 2 steps
- int func(int a, int b) { return (aint x1 = 66; int y1 = 39; int d; _asm { } mov EAX, X1; mov EBX, y1; push EAX; push EBX; pop ECX mov d, ECX; What is d in decimal format?Q11 Draw a DFA/NFA for the following: 1. L = (awbb: w (a,b)*} 2. L= (w1baw2: w1, w2e (a,b)* )#include Servo servo; int const trigPin = 9; int const echoPin = 8; #define red 5 #define green 6 void setup() { pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); pinMode(red,OUTPUT); pinMode(green,OUTPUT); servo.attach(10); } void loop() { int duration, distance; digitalWrite(trigPin, HIGH); digitalWrite(trigPin, LOW);// Measure the pulse input in echo pin duration = pulseIn(echoPin, HIGH);// Distance is half the duration devided by 29.1 (from datasheet) distance = (duration/2) / 29.1;// if distance less than 0.5 meter and more than 0 (0 or less means over range) if (distance = 0) { servo.write(60); digitalWrite(green,HIGH); digitalWrite(red,LOW); delay(200); } else { servo.write(10); digitalWrite(red,HIGH); digitalWrite(green,LOW); delay(80); } } TASK: create a flowchart using this code, showing the input, output and the conditions on the loop. Lastly, the flowchart must return if ever the conditions have met or nota) b) C) d) 1 #include #include int main(){ 2 4 5 6 7 8 9 10 11 12 7 123 TELE 345 13 20 19 8 14 15 1 int a=2, b=a*16, c, d; sqrt(a*b); d = pow (a, c); while (d>250) { d == 2; C++; } printf("%d", c);// Return remainder after integer division // Global variables int a = 4; int b = 30; int main() { // Use registers for local variables int remainder; int divisor; } if (a > b) { } else { } remainder = a; divisor = b; } remainder = b; divisor = a; while (remainder > divisor) { remainder -= divisor; return remainder;if L1={ab,b} L2={abb,bb} then LIL2= * O {ababb,abbb,abbab,bbab} O {ab,b,abb,bb} O {ababb,abbb,babb,bbb} O {abbab,abbb,bbab,bbb}int sum = 0; for (int i 0; i < 5; i++){ sum += i; } cout << sum;Based on the following C code: { int x, y, z, sum, total; int *pt1, *pt2, *ptc; x = 99; y = 86; pt1 = &y; pt2 = pt1; ptc = &x; z = (*(&y))/2 + (*pt2)/3 + 5; sum = (x + y + *pt1 + *pt2 + z)/3; total = sum + *ptc + *pt1; } (1) What is the value of z? (2) What is the value of sum? (3) What is the value of the total? (4) What is the address of the data 86?C++ programming It has been observed by management that some faculty member at the university demonstrates a lackadaisical attitude toward work. They seldom go to class yet at the end of each month they receive full salary. Management has decided that GHs 200, 300, 400, and 500 will be deducted from a faculty’s salary if he/she offends once, twice, third time and forth time respectively in a month. This means that if a faculty member offends once in a month GHs 200 will be deducted, if a faculty member offends twice in a month, GHs 500 (i.e. 200+300) will be deducted, if a faculty member offends three times in a month GHs 900 (i.e.200+300+400), will be deducted and if a faculty member offends four times in a month GHs 1,400 (i.e. 200+300+400+500). Assuming all faculty members are on a flat salary rate of GHs 2500. a. Write a program to request for the names of four faculty members and number times he/she has absented him/herself from class. One of them should have absented him/herself…Match the C-function on the left to the Intel assemble function on the right. W: cmpl $4 movl %edi , %edi jmp .L4(,%rdi,8) %edi .L3: movl $17, %eax ret .15: movl $3, %eax int A ( int x , int y) { int a ; if ( x == 0 ) else i f ( x == 1 ) a = 3 ; else i f ( x == 2 ) a = 2 0 ; else i f ( x == 3 ) a = 2 ; else i f ( x == 4 ) a = 1 ; ret .L6: a = 17; movl $20, %eax ret .L7: movl $2, %eax ret else a = 0; .L8: return a ; movl $1, %eax .L2: ret . section .rodata . L4: .quad .L3 .quad .L5 .quad .L6 .quad .L7 .quad .L8 X: testl %edi, %edi je cmpl je cmpl je стр1 je cmpl .L16 $1, %edi .L17 $2, %edi .L18 $3, %edi int B (int x, int y) { int a; switch (x) { .L19 $4, %edi %al movzbl %al, %eax case 0: a = 17; break; sete break; case 1: a = 3; case 2: a = 20; break; case 3: a = 2; break; case 4: a = 1; a = 0; } return a; ret .L16: break; movl $17, %eax ret .L17: movl $3, %eax } ret .L18: movl $20, %eax ret .L19: movl ret $2, %eaxJSON Response example when code = BAHRAIN as follows: { "Country": "Bahrain", "Tenps"il ("day": "SUNDAY", "temp"i {"day": "HONDAY", "temp": 35), ("day": "TUESDAYr, "teng": 39), ("day": "WEDNESDAY", "tenp": 37),. ("day"i "THURSDAY", "tenp": 35), ("day"i "FRIDAV", "temp": 34), ("day": "SATURDAY", "teng": 37) 1. Implement find Templ ) function as follows: Sample Eample This function will be called whenever the user change the value of the pull-down menu. This function should contact Ve the Web Service API, sending the selected country code, to Co display the information (country, daily temperatures in the week and average weekly temperature) inside the div tag whose id -result as shown in the example on the right. Country ahraln In addition, the country name and the average temperatures should be saved as one JS object inside an array in a local storage. Whenever new request is made, the countrylaverage will be saved and added to the array inside the local storage (duplicates is allowed).…SEE MORE QUESTIONS