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 following equation. S1 = ceil (( x + y) + sqrt (y)); S2 = pow (x, 2)+( fabs ( w)); S3 ceil (S1/S2 ); where x = 4, y= 10, and w=-10
Q: 7) ( )If we define variables: int a=2, b-4, c-6; the value of the following expression ((a> b? a: b)…
A: The required code has ternary operators (denoted by '?' which is short form of if-else) and thus are…
Q: Suppose two line segments intersect. The two end- points for the first line segment are (x1, y1) and…
A: The scanner statement is used to get the input from the user here the main method is to write and…
Q: Write a program with two functions and a main(), each having at least two parameters. The functions…
A: Initializing 2 functions and exchanging information between them.
Q: Write a program that will take input 3 int numbers as input from user in main and pass all numbers…
A: Note: We are authorized to answer one question at a time, since you have not mentioned which…
Q: Васк HowToIl Hentist 1o.par question to have its turtle draw a equilateral triangle. * (7.)Write a…
A: As you mentioned that you want question number 8 so , I solve only question number 8.
Q: need a code for this in C: Define and Implement the following functions: float…
A: Given: To write a c program for the implementation of above function:
Q: Create a function that takes the values dd (Dielectric Outer Diameter), dc (Inner Conductor…
A: Your Ruby code is given below as you required with an output.
Q: Consider the following C++ code: int* length = new int; int* height = new int; *height = 12;…
A: Step 1:- Introduction:- The pointer is a variable that stores the address of another variable.…
Q: Consider this code: "int z = 20; int sum = z++ + --z;". What are the values of z and sum? A.…
A: Refer to step 2 for the answer. I have provided the right answer which is unfortunately not…
Q: main (void) void qst (float a, float b, int "y) float a = 3.0, b = 2.0; int y -6; %3D int x - 4, w-…
A: C program used to answer this question
Q: Q.1) Mark the following statements as true or false and correct the second part if false: 1. The…
A: Array is a collection of similar datatypes. The types of array are Single dimensional…
Q: Question 4 We consider the the following code: #include using namespace std; void add(int i, int…
A: Here in main() function A=1 B=2 C=3 D=1.1 We call add(A,B); => add(1,2) void add(int i,int…
Q: Q1: Complete the following program by writing its functions: static void Main(....) { } 10, 12, 7,…
A: Power(a[1], a[2], ref p); This function is wrong as a is an integer and not an array. So we cannot…
Q: Assembly language
A: Given :- In the above question, the statement is mention in the above given question Need to write…
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: 8: PGandE.cpp) Consider a gas and electric bill that sets two levels of use as follows: Electric 558…
A: #include <iostream>#include <fstream>using namespace std; double calculation(string…
Q: 7.12 Write a program that simulates the control software for a "people mover" system, a set of…
A: The program is given N amount of trains and M amount of stations in a text file; followed by the…
Q: 15. Assuming the following C++ variable declaration statement int i = 2021, *pi = &i, **ppi = π…
A: Given: int i=2021,*pi = &i, **ppi = &pi; //here i is integer variable with value 2021 //pi…
Q: Write the pseudo-code of Q1 using C++ language supposing that you have the following variables and…
A: Solution:: Q2)
Q: Consider the following two type definitions in C: typedef struct { char w; float x; short int y;…
A: 1. for any variable get memory in word if size is less than or equal to 4 byte 2. if double is…
Q: Cone is a three-dimensional structure having a circular base where a set of line segments, connect…
A: A file can be processed in C++ using file streams. The ifstream is used for reading files and…
Q: 17. Consider the following "C" code segment. At least how many test cases are needed for achieving…
A: Each branch of every possible decision point has to be executed at least once. So let's find the…
Q: Question 4 We consider the the following code: #include 2 using namespace std; 3 4 void add(int i,…
A: It is defined as a direct descendant of C programming language with additional features such as type…
Q: (Algebra: solve 2 X 2 linear equations) You can use Cramer's rule to solve the following 2 x 2…
A: // Cramer.java /* * This Program will calculate x and y for two linear equations using Cramers rule…
Q: 2.)Write a program to draw this. Assume the innermost square is 20 units per side, and each…
A: 2) Solution :: Code :: import turtle def myFunction(c,n): for i in range(4):…
Q: 19. In python we do not specify types,it is directly interpreted by the compiler, so consider the…
A: Here is the solution which is mentioned below:
Q: 30 Suppose a, b, and sum are int variables and c is a double variable. What value is assigned to…
A: Given: Suppose a, b, and sum are int variables and c is a double variable. What value is assigned to…
Q: What is the best statement about the following function, f1? void f1 (int i) { int j;…
A: I Step 2 , I have provided correct answer with brief explanation---- and also , I have…
Q: 2) Implement the second phase of Software Development Method (SDM) for this following problem…
A: Below i have given the program:
Q: Calling a recursive function. Write a statement that calls the recursive function…
A: Here we have a method named backwards_alphabet(). In this method, we check if the value passed as a…
Q: 1. Consider the following statements: P(z, y) = "3r € R such that Vy E R, = 2y" Q(z,9) = "Vz € R By…
A: ∃ is existential quantifier. It can be read as "there exists" ∀ is universal quantifier. It can be…
Q: In each of the following code snippets, data is copied from x to y. How many bytes of data are…
A: SUMMARY: -Hence, we discussed all the points.
Q: (a) F(X,Y,Z) = ∑(0,3,4)D(X,Y,Z) =∑(2,6) (b) F(W,X,Y,Z)=∑(0,1,3,5,9,11)D(W,X,Y,Z) =∑(2,4,8,10)
A: (a) F(X,Y,Z) = ∑(0,3,4)D(X,Y,Z) =∑(2,6)(b) F(W,X,Y,Z)=∑(0,1,3,5,9,11)D(W,X,Y,Z) =∑(2,4,8,10) using…
Q: Problem (5) Consider the code in main() below. Write code (in C++) to close as many memory leaks as…
A: Given Code is: int ** pp // double pointer int *p1,p2 // single pointer and simple…
Q: The word limit for this explanation is 350.
A: Final variable: ==>In general we represent a variable as final variable using "final" keyword.…
Q: This is ML. Need help with code through SOML. And working with java (6p) Function max3 of type int…
A: CODE:- The largest of three integers. public class LargestNumberExample3 { public static void…
Q: In C, Assume that the int variables i and j have been declared, and that n has been declared and…
A: The C program and its approach to print a triangle of asterisks are given below: - Approach: -…
Q: A C program. Which circle has two data members, a Point representing the center of the circle.(using…
A: #include<stdio.h>#include<math.h> typedef struct{ float x; float y;}Point; typedef…
Q: .. Define and Implement the following functions: float Area Rect(float length, float width) }returns…
A: The Answer start from step-2.
Q: 8.6.4 The 0 = xD Operator This operator consists of first taking the derivative of a function and…
A: Operator can be defined by its function. Derivative of a function can be represented by D. Where…
Q: Question 1 (a) What are the values of i and j after the following code has been executed andi and j…
A: Given:
Q: 2. Let x be the first three digits of your matric number, AND y be the last three digits of your…
A: I am considering the matric number as 2210039 Now x = 221 and y - 039 we change 0 in y as 2 so, x =…
Q: 20. Write a user-defined function that plots a triangle and the circle that is inscribed inside,…
A: Actually, MATLAB is a programming platform designed specifically for engineers and scientists.
Q: 1) Run the multiple-target assignment statement below by using C++, Java and Python. Display the…
A: Using C++ :- #include <iostream> using namespace std; int main() { int a,b,c;…
Q: 1. Consider the following statements: DATAENDFLAG is off; ERROR equals 0; and SUM is less than 1024.…
A:
Q: 7.12 Write a program that simulates the control software for a "people mover" system, a set of…
A: In this program given thar we have N number of trains and M number of stations in a text file;…
Step by step
Solved in 3 steps
- [2/25, 05:28] Vishal Singh Rawat: Kindly store employee details using class with python program [2/25, 05:28] Vishal Singh Rawat: There are 4 employees Details of all employee: Name: John , Designation: Manager , Salary: 80000 Name: Mike , Designation: Team Leader , Salary: 50000 Name: Derek , Designation: Programmer , Salary: 30000 Designation: Assistant , Salary: 25000 Name: Rajiv) Write a JAVA program to merge two sorted arrays into a single sorted array. Take the sample arrays given below and print the result in the output. The time complexity of the program should be O(N+M) where N and M are the sizes of both the arrays. int []arr1 = {1, 6, 10, 14} int []arr2 = {2, 4, 5, 11, 16, 19} Print the merged array in the output.8.15 (Displaying a Sentence with Its Words Reversed) Write a program that inputs a line of text, tokenizes the line with function strtok and outputs the tokens in reverse order. Solve the full question in c language without using pointers
- C++ 13.9.2 Pass by reference Define a function ScaleGrade() that takes two parameters: points: an integer, passed by value, for the student's score. grade: a char, passed by reference, for the student's letter grade. ScaleGrade() changes grade to A if the points are greater than or equal to 88 and less than or equal to 100, and grade is not A. Otherwise, grade is not changed. The function returns true if grade has changed, and returns false otherwise. Ex: If the input is 88 B, then the output is: Grade is A after curving. Using the following code #include <iostream>using namespace std; // insert code here int main() { int studentPoints; char studentGrade; bool isChanged; cin >> studentPoints; cin >> studentGrade; isChanged = ScaleGrade(studentPoints, studentGrade); if (isChanged) { cout << "Grade is " << studentGrade << " after curving." << endl; } else { cout << "Grade " << studentGrade…Write a single and complete C program to help faculty ‘X’ preparing grades ofEEE 103:a. Ask the user how many students he has in his class and take it as input.b. Dynamically allocate memory and take input of the student’s EEE 103final marks using pointersc. Find the maximum marks obtained among them. The marks must beaccessed using pointer.d. Those who got below 50% of the maximum marks, add 2 marks bonus tothose student’s marks. The marks must be accessed using pointer.e. Consider the final exam has been taken for a total of 45 marks. But theweight of finals for the EEE 103 course is 32%. Now convert eachstudent's marks he received to 32% for preparing the grades. Store theconverted marks in another dynamically allocated array.f. Print the converted marks for all the students.13. Implement function triangleArea(a,b,c) that takes as input the lengths of the 3 sides of a triangle and returns the area of the triangle. By Heron's formula, the area of atriangle with side lengths a, b, and c is √ s ( s−a )( s−b)( s−c ) , where s=(a+b+ c )/ 2 .>>> triangleArea(2,2,2)1.7320508075688772
- 5.21 In Python: A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun. To account for the difference in time, every 4 years, a leap year takes place. A leap year is when a year has 366 days: An extra day, February 29th. The requirements for a given year to be a leap year are: 1) The year must be divisible by 4 2) If the year is a century year (1700, 1800, etc.), the year must be evenly divisible by 400 Some example leap years are 1600, 1712, and 2016. Write a program that takes in a year and determines whether that year is a leap year. Ex: If the input is: 1712 the output is: 1712 is a leap year. Ex: If the input is: 1913 the output is: 1913 is not a leap year. Your program must define and call the following function. The function should return true if the input year is a leap year and false otherwise.def is_leap_year(user_year)4) Answer the question in C++ A) What is wrong with the following code segment? enum CarType {GM, FORD, BMW}; int main() { CartType = BMW; return 0; } B) Assume that the addresses of x and y is 0x61feb8 and 0x61feb0, respectively. What will be the values of x, y, p, and q, respectively, when the following code runs successfully? int main() { int x; double y; int* p = &x; double* q = &y; *p = 3; *q = 3.14; increaseByOne(p, q); cout << x << " " << y << endl; cout << p << " " << q << endl; return 0; }void increaseByOne(int*& p1, double* q1){ (*p1)++; (*q1)++; p1++; q1++;} The four value:3. Consider an 1-d array of type int and a pointer pointing variable pointing to the 2nd item of the array. Write down the code for the following: int arr(10) = (5,6,23,4,89,70,12,78,33); int *ptr = arr+1; (a) Print the first item of the array using ptr. (b) Print all prime numbers of the array using value at address. (c) Print the last item of the array using a pointer to an array. You are not allowed to initialize the pointer to the address of the last item. Iterate using a loop to change the value of the pointer. (d) Now print the array in reverse order using a pointer. 101
- Q3: Write a program in C++ using OOP to create a class (A), that have a two dimensional array X[5][5], and function (input) to read it from keyboard Then create a class(B), with public visibility mode inherit from class (A), contain the function (sample_T) to print the element that form the letter (T)in array (X). Then create a class(C), with public visibility mode inherit from class (A), contain the function (sample L.) to print the element that form the letter (L) in array (X). Then create a class(D), with public visibility mode inherit from class (B) and (C), contain the function (RUN) to call the to function above.1. Implement function postal() that takes 6 inputs: a first name (as a string) a last name (as a string) an address (as a string) a city (as a string) a state (as a string) a zip code (as an integer)and then prints a mailing address in 3 lines as shown below.>>> postal('Ljubomir', 'Perkovic', '243 S Wabash Ave','Chicago', 'IL', 60304)Ljubomir Perkovic243 S Wabash AveChicago, IL 60304Q#2 Write a recursive function zeroCount ( int a[ ], int s, int e) that receives an array of integers a [], a start index s, and an end index e. The function should return the number of zeros in that array between s and e. int zeroCount ( int a[ ], int s, int e); Trace your function given the following array and function call. Draw your steps. int a[ ] = {1, 0, 0, 5}; int zeros = zeroCount(a, 0, 3); language c++