int first = 16; int second = 8; if ((first / second == 2) || (second / first == 3)) { second = 10;
Q: This exercise assesses the skills required to develop user defined functions, and pointers. Task:…
A: Write a C++ program to develop a Vehicle Fine Management System for Police. The program will have…
Q: I need help writing this code in C. It begins by making a struct that holds 2 other structs inside…
A: Hello student Please Please Please do like Because this is the accurate code I have written below
Q: Use functional decomposition to write a C++ program that asks the user to enter his or her weight…
A: Objective: This program determines the weight of the user if the type of the planet is given. Planet…
Q: Please help with the following C# Please explain the following code and some of the syntax like…
A: Required: Please help with the following C# Please explain the following code and some of the syntax…
Q: hen is not appropriate to use while iterative structure compared to do-while? O A. when a…
A: Answer is given below .
Q: The annual percentage rate convention for calculating compound interest is as follows: The future…
A: //iostream for input output operations #include <iostream> //cmath for mathematical operaions…
Q: Write a C++ program to develop a Vehicle Fine Management System for Police. The program will have…
A: #include <iostream>using namespace std;class Student{ public: int rollno; string…
Q: Make this C language code into modular code (functions) #include #include main() { char choice; int…
A: CODE:
Q: Rewrite Program 3 where the following operators are overloaded: >> << + - * == != Also…
A: The required C++ code is: #include <iostream>using namespace std;//This program uses a class…
Q: I need help in this question of C Programming dealing with structs Structs given struct DateTag{…
A: The following solutions are
Q: c++ computer language what is the output of the following code segment? int main() { int…
A: Given C++ Program: #include <iostream>using namespace std;void sub(int arr[], int z) { for(int…
Q: In C++, create a program which will read a phrase from the user and create a framed version of it…
A: Actually, c++ is a powerful general purpose language.
Q: ?following C++ code #include #include using namespace std; class A { float d; public: ACO{…
A: In this question, we have given a C++ code. This code involves class and constructor. We have to run…
Q: ABC Blood bank wants to display a Welcome and a Thank you message for all their Blood donors as a…
A: Let's understand step by step : 1. Declare a class Donor which public data variables : string…
Q: ABC Blood bank wished to welcome and thank all their eligible donors as a symbol of respect. Write a…
A: Main.cpp Donor.cpp
Q: calculator (4 operations) Create a class Weight which contains: • Kilograms (kgs) • Grams (g) Write…
A: The program is created by the steps below: Create a class names Weight with the variables kilogms…
Q: FOR C++, PLASE SEND THE ANSER IN 30 MINUTES. ACCORDING TO CODE BELOW, #include "Vehicle.hh"…
A: Since the Vehicle class is not entirely given, we will make assumptions while writing down the code.…
Q: C++ programming Chapter(s) Covered: Chapter 1-8 Concepts tested by the program: Working with one…
A: Code: #include<iostream>#include <algorithm>using namespace std; // Global…
Q: numerical methods Please write the code in c++. Provide code in text format so that I can run.…
A: #include<bits/stdc++.h> using namespace std; #define N 3 // Number of unknowns //…
Q: I asked for this to be written in c# instead I got C. Please create a console application of…
A: Given: We need to explain below point in c#. 1. Declare variables with proper data types2. Be able…
Q: Select the four (4) statements that can be inserted at line n1. (3 pts. eac public class Employee {…
A: Given :
Q: Write assignment statements for the following: Assign a value of 1 to between if n is in the range…
A: The answer is as follows:-
Q: Show the output of the following code: #include <iostream> using namespace std;class Parent…
A: Answer: Create a derived class that is inherited from the base class. // Derived class class child…
Q: Write a program that: Defines an enum named Classification. The enum Classification will have 2…
A: An enumeration is a user-defined data type that consists of integral constants. To define an…
Q: Example 2: Write a menu driven program in 'C' which shows the working of library. The menu option…
A: ans is given below
Q: hên a parameter nd to be 1obal, A Pis a program that manages all others B Pis used by all…
A: Option (C) is the correct option Global means can be referred anywhere and is available to…
Q: In this c++ program edit this code and please input the following details Following details Name…
A: if you want to remove winner and percentage then we dont need this function void outputElection()
Q: Write a program Declare a data structure marks_t, which contains the following type int members: …
A: Required: Write a program Declare a data structure marks_t, which contains the following type int…
Q: 2 class lineType | Instructions 3 { 4 public: The equation of a line in standard form is ax void…
A: Code for class LineType: #include <iostream> using namespace std; class LineType { public:…
Q: In C++, write declarations to declare each variable to have the specified type and initial value:…
A: The declarations and initializations of the given variables are done as follows:…
Q: *C Programming This exercise is to help you learn how to debug compiler warnings/errors and other…
A: C is the object oriented programming languages. It is a powerful general purpose languages and are…
Q: In C++, the definition of any variable (e.g. int x;) tells the compiler about O all of the above the…
A: Here the 1st option : all of the above is correct
Q: The compiler automatically performs several common conversions between int and double types, such…
A: Solution :
Q: Make this C language code into modular code (functions) #include #include main() { char choice; int…
A: #include<stdio.h>#include<math.h> void squareroot(int n1){ int result = sqrt(n1);…
Q: C# PROGRAM convert this spaghetti code to modular (oop) use functions
A: class Program { public static void Main() { int opt; //to read the user input for option bool…
Q: Code using c++ 3. From Person to People by CodeChum Admin Now that we have created a Person, it's…
A: Your C++ program is given below as you required with an output.
Q: Q1. Write the missing C statements in the incomplete C program below: * #include //i. Write the…
A:
Q: (C PROGRAMMING ONLY) 3. From Person to People by CodeChum Admin Now that we have created a…
A: AS there were no restriction stated hence made this way. Screenshot is also attached (note that to…
Q: Create a class “Student” with data members such as roll number, name and branch. Create another…
A: Algorithm: Start Define a class Student with data members roll number,name,branch and constructor…
Q: Assume there is a function called mystery. It already has the following prototype: void mystery(bool…
A: The prototype that is not a proper overload for the mystery is void mystery(bool valid);. Therefore…
Q: Please define the following structures in your main function: • One structure that will represent a…
A: Note: Comments have been added to the source code itself to have a better understanding of the code.…
Q: #include void main(void) { int c=2 ^ 3;
A: Please find the answer below :
Q: Write the declaration for a stuct that has the following public data memebers: a string for the name…
A: The below program is solved using C++
Q: Develop a body mass index (BMI) caleultor program that reads body weight and height as inputs and…
A: The complete C program is shown below. Sample Response: //C program#include<stdio.h>//main…
Q: Fix the following c++ code : #include using namespace std; void Ashraf(int [][],int,int); int…
A: There are 2 mistakes in this code. 1. The closing parenthesis of function Ashraf is missing. 2.…
Q: Can
A:
Q: A program reads three numbers such as P, Q and R that ranges between [1, 50] and prints the largest…
A: Given data is shown below:
Q: c. Refer to the C++ program in Figure 1.1Gad answer Question 1e (1) - (xi). Otinclude tinclude…
A: input radius1 and radius2 it basically calculates the volume of two sphere volume of sphere is =…
Q: An electricity board charges the following rates to domestic users:- Units consumed Tariff For the…
A:
using the given code: #include <iostream>
using namespace std;
int main()
{
int first = 16;
int second = 8;
if ((first / second == 2) || (second / first == 3))
{
second = 10;
first = 20;
}
else if ((first % second == 2 || second % first == 1))
{
second = 15;
first = 5;
}
else
{
first = -10;
second = -20;
}
cout << first << " " << second << endl;
return 0;
}
what is the output if
a. first = 16 second = 5
b. first = 26 second = 8
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- Write program in C++ Language The other solutions on chegg were incorrect! Please read carefully! Write a program that defines and tests a class called COP3014. The class resembles aclassroom. It has the following grading scheme:3 quizzes 20 points each 20%Mid term 100 points 30%Final 100 points 50%Based on the total grade of any student for the course, the letter grade of each student can becomputed as follows:Any grade of 90 or more is an A, any grade of 80 or more (but less than 90) is a B, any grade of70 or more (but less than 80) is a C, any grade of 60 or more (but less than 70) is a D, and anygrade below 60 is an F.This class needs to have some member variables. The first name, last name, the Z-number, thegrades, the total grade and final letter grade are all considered to be private member variablesof this class.The class should also have the following public member functions/procedural attributes that canbring the objects (students of the class) to life and give them some…FOR C++, ACCORDING THE VEHICLE HEADER, FILL THE PART 1 OF THE CODE #ifndef _Vehicle_hh_ #define _Vehicle_hh_ class Vehicle { private: float speed; float mile; public: Vehicle(); Vehicle(float, float); float getSpeed(); float getMile(); void setSpeed(float); void setMile(float); void print(); }; #endif (DEFINE FUNCTIONS CORRESPONDING TO VEHICLE HEADER CLASS IN PART 1 BELOW) #include "Vehicle.hh" #include "Ship.hh" #include <iostream> using namespace std; // *** DEFINE --VEHICLE-- FUNCTIONS FOR PART 1 *** // *** DEFINE --SHIP-- FUNCTIONS FOR PART 2 *** void reduceSpeed(Ship*, float); void takePassenger(Ship*, int); int main() { return 0; } // reduce the speed of ship given in percentage (0 < percentage < 1). void reduceSpeed(Ship *s, float percentage) { // *** FILL THIS FUNCTION FOR PART 3 *** } // takes the number of passengers to the ship void takePassenger(Ship *s, int pas) { // *** FILL THIS FUNCTION FOR…Analyze the following code and identify critical syntax mistakes and write the correct answer 2. int time=50; while { System.out.print(time + ","); }(time < 53) 3. public class Main { public static void main(String[] args) { int val = 1235; var loop = 0;
- Create a class “Student” with data members such as roll number, name and branch. Create another class “Exam” for storing marks of three subjects. Derive a new class “Result” from “Student” and “Exam” class with data members such as total and average. Display the values of all the data members. Develop a C++ program to model the above relationships. Include comments for the code. Also, can you include screenshots of the code and the output as well Test cases Private – Input 1000 ABC CSE 90 80 70 Output 240 80 Public – Input 2000 DEF IT 25 30 35 Output 90 30Please solve usnig c++ programming language. Number Converter Program as described in the UML has the following functionality.1. Read a number from the user and find its base. If number is exceeding the limit of 16-bits,ask user to re-enter the number. Use parameterized constructor Conversion(char *) toinitialize the data member.int FindBase(char []);There are a few assumptions. i) If all digits of a number are 0 or 1, the number is binary. For example, 1010 will beconsidered a Binary number only.ii) A hexa-decimal number must have letter A, B, C, D, E or F. Otherwise the number willnot be considered a hexa-decimal.iii) Decimal number must have minimum one digit greater than 7. Otherwise, the numbercan be considered as Octal if it does not meet the criteria in point no. i and ii.2. Converting the number to Binary if the number is not Binary.char * ToBinary(char *);3. Converting the number to Octal if the number is not Octal.char * ToOctal(char *);4. Converting the number to…In C++ QUESTION 14 class rectangleType { public: void setLengthWidth(double x, double y); //Sets the length = x; width = y; void print() const; //Output length and width double area(); //Calculate and return the area of the rectangle (length*width) double perimeter(); //Calculate and return the perimeter (length of outside boundary of the rectangle) private: double length; double width; }; Write the function definition for the function perimeter
- ( C PROGRAMMING ONLY) 2. Solving a Person's Lonelinessby CodeChum Admin It's been 1,245 years and our sole Person is getting lonelier each day. This Person definitely needs a partner! Thus, we need to update our Person's design to have a gender as well and there shall be male and female! Instructions: In the code editor, you are provided with the definition of a struct Person. This struct needs an integer value for its age. Furthermore, you are provided with a displayPerson() function which accepts a struct Person as its parameter.Your task is to first update the struct Person so that it can have a gender as well. For this program, we shall represent a gender with a single character: 'M' for male and 'F' for female.Then, create a Person, take in an integer user input and a character user input, and then set them as the Person's age and gender respectively.Finally, call the displayPerson() function and pass that Person you created.Input 1. The age of the Person 2. The gender of…Consider the following application. Identify and correct any syntactic errors or omissions by rewriting the line number and the corrected line. Note: There are 8 lines with errors. Each line may have multiple errors. Here’s an example (here, the error is on line 2, the correction is in bold – int x = 0;): 01 public static void main(String[] args){ 02 int x = '0'; 02 int x = 0; 03 int y + x = 7 03 int y = x + 7; 04 } 01 public Class Average; 02 { 03 public void main(String [] args) 04 { 05 double sc = (70, 75, 90, 83, 85, 97, 82, 79, 94, 87; 06 double me su = 0.0 07 for (int k = 0; k < sc.length(); k++); 08 su += sc[ ]; 09 double me = su/sc.length() 10 System.Out.printf("Output: %.2f" + me); 11 } 12 } What value of the variable me will be printed in line 10?From structure Date as declared in code given below, define TWO (2)variables called regDate and payDueDate. #include<stdio.h>struct date{int day;int month;int year;} birth; int main(){// assign value to name of birth birth.day=17; birth.month = 11; birth.year = 1996; // print struct variables printf("Date of Birth(dd/mm/yy) :- %d/%d/%d\n", birth.day, birth.month, birth.year); return 0;}
- PLease write the code in C++. Thank you so much. Write A Class Declare a class/struct named NutritionData that contains these private fields foodName (string) servingSize (int) calFromCarb (double) calFromFat (double) calFromProtein (double) Use the data types in parentheses for the fields. Note that you need to use the proper C++ syntax for the fields. Each field should have a comment documenting what it is for. Place one comment above each field. Add the public default constructor. Read the textbook for the syntax of the default constructor. Write the body of the default constructor inline. The default constructor initializes the fields so that the food name is an empty string and all other fields are 0 for int and 0.0 for double. Add public mutator member functions to set the fields. One mutator member function for each field. Each mutator member function's name should begin with the word 'set' followed by the field name with the first letter changed to uppercase. Each member…(C PROGRAMMING ONLY) 3. From Person to Peopleby CodeChum Admin Now that we have created a Person, it's time to create more Person and this tech universe shall be filled with people! Instructions: In the code editor, you are provided with the definition of a struct Person. This struct needs an integer value for its age and character value for its gender. Furthermore, you are provided with a displayPerson() function which accepts a struct Person as its parameter. In the main() function, there's a pre-created array of 5 Persons.Your task is to ask the user for the values of the age and gender of these Persons.Then, once you've set their ages and genders, call the displayPerson() function and pass them one by one.Input 1. A series of ages and genders of the 5 Persons Output Person #1Enter Person's age: 24Enter Person's gender: M Person #2Enter Person's·age: 21Enter Person's gender: F Person #3Enter Person's age: 22Enter Person's gender: F Person #4Enter Person's age: 60Enter…Overload the assignment operators (=) for Box class. Your operator must be able to do multi-level assignments, e.g., statements like “b3 = b2 = b1;” must work as expected. A sample output is given below: Distance d1: 3'-9" Distance d2: 3'-6" After assigning d1 to d2 to d3 Distance d1: 3'-9" Distance d2: 3'-9" Distance d3: 3'-9" using c++