1 #inlcude using namespace std; 3 int main() 4日{ 2 float a; cin>>a; if (a==0): cout<<"X"; else: 6. 7 8. 9. cout<<"Y"; if(a>0): 10 11
Q: The following declaration, program, and program segment has errors. Locate as many as you can.…
A:
Q: 1I. Running the Race Write a program that asks for the names of three runners and the time, in…
A: The given problem is related to Java programming where the user will enter 3 names and 3 times in…
Q: 3.17 (Game: scissor, rock, paper) Write a program that plays the popular scissor–rock–paper game.…
A: Answer :
Q: C++ Visual 2019 A particular talent competition has five judges, each of whom awards a score…
A: Note: As score can double data type ,so, return type of findLowest() and findHighest() function…
Q: Activity #2: Taking limits to compute derivatives Write a program named Lab5a_Act2.py to compute a…
A: Actually. Python is a easiest programming language. It is a dynamically typed programming language.
Q: **3.19 (Geometry: point in a circle?) Write a program that prompts the user to enter a point (x, y)…
A: Step-1: StartStep-2: Declare variable x, y, distanceStep-3: Calculate distance by using square root…
Q: #include using namespace std; void myfunction(int num2,int num1); int main(){ myfunction(5,2);…
A: Please find the answer below :
Q: 2. Loan Repayment' Write a program that helps a loan company determine the payment schedule for…
A: HI THEREI AM ADDING ANSWER BELOWPLEASE GO THROUGH ITTHANK YOU
Q: #include using namespace std; void myfunction(int num2, int nu int main(){ myfunction(5,2); return…
A: Function declaration is done in the third line saying myfunction accepts two integer parameters and…
Q: members , D, s, c, and m. The program should define a four variable of type numbers and input values…
A: struct structure_name{ data-type member-1; data-type member-2; data-type member-3; data-type…
Q: #include using namespace std; void car(){ { cout << "Audi R8"; int main() { car("BENZ"); return 0;…
A: It will give compile time error. as, function Car has NO arguments but during function call ONE…
Q: Question 1 Create a VB.NET Console Application that does the following: Create a variable of Integer…
A: Module VBModule Sub Main() Dim marks as integer' to declare marks as integer Dim grade as…
Q: 3.21 LAB: Smallest number Write a program whose inputs are three integers, and whose output is the…
A: Program Approach: Including essential header files and using namespace for standard I/O. Giving…
Q: 10. Future Value Suppose you have a certain amount of money in a savinggs account that earns com-…
A: Required:
Q: C++ program where a user can input his weight and height and the program suggests him a suitable…
A: C++ used to answer this question
Q: Write a program that calculates your grade in this class based on weights for each category and…
A: Algorithm Start Recieve input score from user for reading assignment and assign it to a variable(…
Q: I am using python. How would this code be written? Can someone explain the loop concept?
A: Program: #input for available candy barscandyBar=int(input("Please enter the number of candy bars…
Q: 4. (Calory.java) Write a program that asks the user to enter the number of calories and fat grams in…
A: PROGRAM INTRODUCTION: Import the required libraries. Start the definition of the main function.…
Q: Q5: Complete the function that calculates the position of an object at any time t> 0. The initial…
A: code def calculate_position(s0,u0,a,t): position = u0*t + 0.5*a*t*t position=position+s0…
Q: C++ Programming Problem: To make telephone numbers easier to remember, some companies use letters…
A: A required C++ program is as follows, File name: “main.cpp” #include <iostream> using…
Q: Introduction to python programming
A: The python program and its approach are given below: - Approach: - Creating a nested list and…
Q: #include // this line can be placed second instead of first #include // this line can be placed…
A: Approach: Import the essential header. Defining the main method. Initialize the symbolic constant…
Q: include using namespace std; main () { int a, b, c, sum; cout >a; cout > b; cout > c;
A: I have given output with the explanation step wise step below.
Q: The following declaration, program, and program segment has errors. Locate as many as you can.…
A: Answer: The "function header" is a portion of the function definition. It denotes, Function's…
Q: What is pass-by-value? What is pass-by-reference? Show the result of the following programs:
A: In call by value, the actual value that is passed as argument is not changed after performing some…
Q: 2.25 (Divisible by 3) Write an application that reads an integer and determines and prints whether…
A: NOTE : As the question is not specific about the programming language to be used to code the…
Q: #include using namespace std; int main(){ int i = 8; do { i--; cout << i--; while(i); return 0;
A: second option is correct option. prints 7531
Q: c. Engineering Application: Electric Field for an Insulating Sphere of Charge Use filename:…
A: #include <iostream> #include <cmath> using namespace std; const double Q = pow(10,-9);…
Q: *2.25 (Financial application: payroll) Write a program that reads the following infor- mation and…
A: The complete code with output given below.
Q: Q5: Complete the function that calculates the position of an object at any time t> 0. The initial…
A: Input : Given the s0,u0, a, and t. Output : Value of position.
Q: In Python, use only some or all of the following concepts: decision structures, repetition…
A: Python code: def grade_average(marks_lst): #function to find average of all the marks s =…
Q: View //This pseudocode is intended to display employee net pay values. E//All employees have a…
A: The solution for the above given question is given below:
Q: #include // this line can be placed second instead of first #include // this line can be placed…
A: Explanation: The modified C++ program to calculate the expected time taken to fall from specific…
Q: Background: Commissions are a form of employee payment where the employee, usually a salesperson,…
A: It is defined as a term which is often used in programming and algorithm based fields. It is a…
Q: change normal body temperature to 36.5–37.5 °C #include using namespace std; int main() { float…
A: Given, Change the code so that normal body temperature is 36.5–37.5 °C
Q: 3.12:The Speed of Sound The speed of sound depends on the material the sound is passing through.…
A: Note: Since no programming language is mentioned, the program is provided in Java programming…
Q: Activity #2: Taking limits to compute derivatives Write a program named Lab5a_Act2.py to compute a…
A: Since you are asking multiple questions, we are answering first question for you. If you want…
Q: #3include using namespace std; int main() { int n = 10; int *m &n; cout<<*m; return 0; }
A: - The question wants to know the output of the following code. - The code ::…
Q: main(){ int a=10; a++; cout<<a++;return 0;} * Linking Error О 11 Compilation Error О 10 What…
A: Firstly a=10 a++ means 10 becomes 11 and in next statement becomes a=12 but it prints 11 because of…
Q: Flx the errors of this code #include namespace std; int main { int a if a 10; < 20 cout << "a is…
A: Solution: Given Code:
Q: V7 This pseudocode is intended to display // employee net pay values. All employees have a standard…
A: Program plan: Declare the variable name Define the variable EOFNAME as "ZZZZ" Define DEDUCTION as…
Q: C Sharp case Problem 2-1 In Chapter 1, you created two programs to display the motto for the…
A: C# Program is given below - This program takes input from the user. The input is not validated as…
Q: Exercise - Functions and Optionals If an app asks for a user's age, it may be because the app…
A: the code is given below :
Q: The Barking Lot is a dog day care center. Design a flowchart or pseudocode for the following: d.…
A: Pseudocode :- start Declaration num idNm String nme String breed num age num weigh num bil num QUIT…
Q: 3.12:The Speed of Sound The speed of sound depends on the material the sound is passing through.…
A: Dear Student, The complete source code for your asked program is given in step 2 , with necessary…
Q: : Correct the syntax errors void Main () { int x, Y; const a = 14; ww w cin >> x , y; ww if a=x*y;…
A: Things needed to be remember:- c++ is a case sensitive programming language. if you need to use…
Q: [In C#] Write an application named SumInts that allows the user to enter any number of integers…
A: Given - I need to write a C# code to take numbers from user until user enters 999 and print the sum…
Q: Assignment statements based on input value Write an if-else statement that assigns finalValue with…
A: Answering first question as per the guidelines. The problem is based on the basics of functions in…
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
Step by step
Solved in 2 steps with 3 images
- Programming tracing C language Please help it is tracing on c programming kindly input the visual tracing like line where the process start or error Trace the following program: (1) void trace1(int x, int *y){ x = 5; *y =2;printf(“%2d %2d\n”, x, *y);}main( ){int x, y;clrscr( );x = y = 3;trace1(x, &y);printf(“%2d %2d\n”, x, y);getch( );return 0;}TIME CLASS (C++) - Write a time class named timeClass - Write code to demonstrate that it works - The timeclass class will be named timeClass - The class must have these 3 constructors: #1) timeClass(); #2) timeClass(int h, int m, int s); #3) timeClass (string timeIn); - The string constructor must be capable of being separated by colons or blanks time in the 24-hour format: example 23:11:07 or 9:4:9 or 11 31 27 - DO NOT use some system functions for this assignment. You must write the code. - Yes, you can convert from string to integer stoi ( string). - In addition to the constructors, you should supply a set of getters (Accessors) getH, getM getS - In addition to that, add mutators that allow the individual setting of Hours, Minutes and Seconds: setH(int), setM ( int ) setS( int ) Include this setter ( Mutator) setTime( int NumSeconds); - So if I call setTime( 7673) you would know that that is: -- hours, -- minutes and -- seconds seconds = 53 7673 % 60…TIME CLASS (Language: C++) - Write a time class named timeClass - Write code to demonstrate that it works - The timeclass class will be named timeClass - The class must have these 3 constructors: #1) timeClass(); #2) timeClass(int h, int m, int s); #3) timeClass (string timeIn); - The string constructor must be capable of being separated by colons or blanks time in the 24-hour format: example 23:11:07 or 9:4:9 or 11 31 27 - DO NOT use some system functions for this assignment. You must write the code. - Yes, you can convert from string to integer stoi ( string). - In addition to the constructors, you should supply a set of getters (Accessors) getH, getM getS - In addition to that, add mutators that allow the individual setting of Hours, Minutes and Seconds: setH(int), setM ( int ) setS( int ) Include this setter ( Mutator) setTime( int NumSeconds); - So if I call setTime( 7673) you would know that that is: -- hours, -- minutes and -- seconds seconds = 53 7673…
- C++ code: int v = 0, w = 1, int main(void) { W = z; V = W + x; y = W X; Z = z -1; } X = 2, y = = 3, z = 5;C++ Pet Class You are going to organize and show information about pets in a Pet Store using a Pet class. The Pet class You need to make a Pet class that holds the following information as private data members: the name of the pet (e.g. "Spot", "Fluffy", or any word a user enters) the type of pet (e.g. dog, cat, snake, hamster, or any word a user enters) level of hungriness of the pet (2 means hungry, 1 means content, 0 means full) Your class also needs to have the following functions: a default constructor that sets the pet to be a dog named Buddy, with level of hungriness being “content” a parameterized constructor to allow having any type of pet the order of the parameters is: name of the pet, type of pet, hungriness level a PrintInfo function that prints the info for the pet according to the sample output below a TimePasses function that increases the hungry level of the pet by one (unless its hungry level is already 2, meaning hungry). a FeedPet function that changes the…C++ Pet Class You are going to organize and show information about pets in a Pet Store using a Pet class. The Pet class You need to make a Pet class that holds the following information as private data members: the name of the pet (e.g. "Spot", "Fluffy", or any word a user enters) the type of pet (e.g. dog, cat, snake, hamster, or any word a user enters) level of hungriness of the pet (2 means hungry, 1 means content, 0 means full) Your class also needs to have the following functions: a default constructor that sets the pet to be a dog named Buddy, with level of hungriness being “content” a parameterized constructor to allow having any type of pet the order of the parameters is: name of the pet, type of pet, hungriness level a PrintInfo function that prints the info for the pet according to the sample output below a TimePasses function that increases the hungry level of the pet by one (unless its hungry level is already 2, meaning hungry). a FeedPet function that changes the…
- C++ Programming Assignment 6 Dynamic Pets The objective of this lab is to demonstrate dynamic allocation and deallocation of memory. Instructions: Write a class called Pet that contains an animal’s name, type, and weight. Include a default constructor and destructor for the class. The constructor should print out the following message: “Creating a new pet”. The destructor should print out the following message: “In the Pet destructor.” Include appropriate get/set functions for the class. In main(), prompt the user to enter the number of pets in his or her household. Dynamically create a built-in array based on this number (not a vector or object of the array class) to hold pointers to Pet objects. Construct a loop in main() that executes once for each of the number of pets that the user indicated. Within this loop, ask the user to enter the name and type of pet. Using a random number generator, generate a weight between 1-100 pounds. Seed this random number generator with 100.…QUESTION 21 int x1=200; int y1=3003; int z1, z2, z3, z4; int d1, d2, d3; _asm{ mov EAX, x1; 200 mov EBX, y1; 300 mov z1, ESP; assume initial ESP: OFFF FFEA add EAX, x1; 400 push EAX; mov d1, EAX:400 mov z2, ESP; push EBX; SUB EBX, x1; 300-200=100 mov d2, EBX; mov 23, ESP; POP ECX; MOV d3, ECX; MOV z4, ESP; POP EDX; mov d4, EDX; What is z3 in Hexidecimal? O OFFF FFEA O OFFF FFE6 OFFF FFE2 OFFF FFEEQ No 3. #include <string> using namespace std; class Account { public: Account(string accountName, int initialBalance) { name=accountName; if (initialBalance > 0) { balance = initialBalance; } } void deposit(int depositAmount) { if (depositAmount > 0) { balance = balance + depositAmount; } } int getBalance() const { return balance; } void setName(string accountName) { name = accountName; } string getName() const { return name; } private: string name; int balance; }; Rewrite the following code in correct form. a) Assume the following prototype of destructor is declared in class Time: void ~Time(int); b) Assume the following prototype of constructor is declared in class Employee: int Employee(string, string);…
- JSON 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).…LOVELY PROFESSIONAL UNIVERSITY Academic Task No. 1 School : of Computer Science and Engineering Name of the faculty member_Ms. Gauri Mathur_ Course Code: CSE202 Faculty of: Technology and Sciences Course Title: Object Oriented Programming Program: Max. Marks: 30 Term: Is Rubric Applicable: No Date of Allotment: 26/02/2021 Date of Submission: 09/03/2021 Important Guidelines: 1. All questions in this Academic Task are compulsory. 2. It is mandatory to attempt all questions of the assignment in your own handwriting on A4 size sheets/pages with a blue colour ink pen. Any other mode of attempt (typed or printed codes or table) except hand written/drawn will not be accepted/considered as valid submission(s) under any circumstances. 3. Every attempted sheet/page should carry clear details of student such as Name, Registration number, Roll number, Question number and Page number. The page numbers should be written clearly on the bottom of every attempted sheet in a prescribed format as: for…please correct this code i didnt get the mistake #include<stdio.h>#define NROWS 8#define NCOLS 8#define TRUE 1#define FALSE 0 void main(){ int queenht_row, queenht_col; int line,row,col,i,j; int filled; printf("Chess queenht Program\n"); do{ printf("Enter queenht's coordinates: "); scanf("%d %d",&queenht_row,&queenht_col); }while((queenht_row<1)||(queenht_row>NROWS)||(queenht_col<1)||(queenht_col>NCOLS)); for(line=1;line<=2*NROWS+1;line++){ row = line/2; if(line%2!=0){ printf("+"); for(col=1;col<=NCOLS;col++) printf("---+"); printf("\n"); } else{ printf("|"); for(col=1;col<=NCOLS;col++){ filled=FALSE; if((row==queenht_row) && (col==queenht_col)){ printf(" Q |"); filled = TRUE; continue; }…