Question 12 Consider the following program written in C pseudocode: void foo(int x, int y){ y = y + 9; x = x + y; void main(){ int a = 6; int b- 5; foo(a, b); For each of the following parameter-passing methods, what will be the values of a and b after running the program? 1) Passed by value 2) Passed by reference 3) Passed by value-result 1.а - b = 2. a = b = 3. а - b =
Q: In a c++ program, assume a class called Account, which models a bank account, contains: two private…
A: Actually, program is a executable software that runs on a computer.
Q: Convert given C language code in C++ by defining your own set of classes. From problem understanding…
A: Object Oriented Approach is always a better approach than Structure Oriented Approach In Object…
Q: The following C++ code consists of an error. What is the cause of the error? class Human{ public:…
A: This is based on the concept of virtual functions in C++
Q: Write c# equivalent statements for the following: There is a book library. Define classes…
A: Arrays in C# are actually objects, and not just addressable regions of contiguous memory as in C and…
Q: In c#, Method is a separate code block and that contains a series of statements to perform…
A: EXPLANATION: The method in C# is a discrete code block that comprises a sequence of statements that…
Q: write a c++ program dont use high end programming symbol such as this-> A single Employee can not…
A: 1. create a class company.2. create constructor and destructor for same.3. now create a base class…
Q: read the instructions carefully In this Question, you are required To understand and analyze…
A: It is defined as a direct descendant of C programming language with additional features such as type…
Q: It is a library service program to issue book based on ISBN and book title. Identify the code smells…
A: Consider the Borrower class.
Q: write a c++ program with following instructions A Car is composed of four Wheel thingies. If a car…
A: Program is made as per the above instructions. Declared classes with functions Main function is…
Q: Q₁: Answer all of the following: 1- A derived class can have one based class only. (True or False)…
A: Answer the above questions are as follows
Q: Write in C++ a program that would print the information (name, year of joining, salary, address) of…
A: C++ code is as follows :
Q: Write a C++ program that does the following: Write a class named Student that has the following…
A: Code in c++ with constructor: #include <iostream> using namespace std; class Student {…
Q: Analyse the imperative program code as shown in Listing 1. Adapt each of the programming methods…
A: To create a file in java, we need to import java.io.File package.File object is an abstract…
Q: In a c++ program, assume a class called Account, which models a bank account, contains: two private…
A: The given problem is to be solved in the C++ programming where a header (account.h) , implementation…
Q: Write a program In C++ to define a class “Bank” that has a member “Bank_Balance” . A person opens…
A: #include<bits/stdc++.h>using namespace std; class bank{int acno;char nm[100];public:…
Q: Assignment: Class, Constructors, Destructors 1. Write a c++ program that uses that has a class…
A: #include<iostream>#include<stdio.h>#include<string.h>#include<cstdlib>using…
Q: Q#1: - Apply Forward Engineering (1.e. produce C++, C# or Java code) of belo Class Model. 13 +…
A: JAVA code : File name: “B.java” public class B { void op() void B() } File name: “D1.java”…
Q: Q1. Write a C++ program which will perform the following operations: • Define a class with name Car…
A: A constructor is a member method that is invoked automatically as the object is created. It…
Q: For each of the following two code sketches complete the following three steps: Use abstraction and…
A: A sketch which refers to the name that Arduino uses for a program. It is called the unit of code…
Q: Please write a C++ program to Create a class Bank_System which hold information regarding customer.…
A: Given: 1. Add Customer Information 2. Deposit Amount 3. Withdraw Amount. 4. Display Customer…
Q: SOLVE IN "C#" Write c# equivalent statements for the following: There is a book library. Define…
A: using System; class book{ string name; string author_name; public book(String b, string a)…
Q: Write a C++ program to check for the not-eligible donor by throwing a custom exception. Strictly…
A: #include <iostream>#include <sstream>#include "Donor.cpp"using namespace std;int…
Q: A reference parameter is a formal parameter that receives the memory address of its corresponding…
A: When we pass address in function it is then known as call by reference function.
Q: Create a C++ program for the Tic-Tac-Toe game with as many as small functions. Also.
A: We can create a two-player Tic Tac Toe game in C++ language using Array, Function and True-False…
Q: 5- When de we need to use private keyword in C++ class? 6- A derived class can be a base class for…
A: 5) When you need private keyword in c++ class 6) Derived class can be a base class for other class…
Q: write a C++ program to Create a class Bank_System which hold information regarding customer.…
A: Note: Program designed based on procedure mentioned in the question. code: #include<iostream>…
Q: Write a Program in C++ which completes following requirements: a. Create a class, having a static…
A: #include <iostream>using namespace std; class IDGenerator{private: static int s_nextID; //…
Q: Write the C++ program with the help of the class complex, to find out the addition, subtraction,…
A: A complex number is a combination of real and imaginary numbers. Imaginary numbers are represented…
Q: b) Describe a procedure visitors should follow to find a free parking space when the space they are…
A: I'm providing you the both B and c part of the above mentioned. I hope this will help you..
Q: Write a java program using Encapsulation for the following class diagram. Get the values of name, id…
A: Requirement- Create a Student class with the given members and methods. Create a Main class and…
Q: Answer only one question: 1- Write a C++ class and choose any name for it. The class should have two…
A: class Calculate: Start Declare num1, num2 as private Declare num3, num4 as public Calculate()…
Q: Write a C++ program to create a new date by the user. The user will type in month, day, and year…
A: #include <iostream>using namespace std; class Date{ private: int date; int month;…
Q: Write code in java to solve the following problems. Question 1: Most important Class in Customer…
A: The get method is used to obtain or retrieve a particular variable value from a class. A set value…
Q: Question 1: Write a program in C++ that implements a library management system. The program MUST…
A: Solution: //C++ code: //include necessary header files#include <iostream>#include…
Q: Write a C++ program containing a class named Employee having Employee Name, Employee age, Employee…
A: According to the question below the Complete Program: Program Output:
Q: Q1. Write a C++ program which will perform the following operations: • Define a class with name Car…
A: Q1. C++ Code for given scenario: #include <iostream> using namespace std; class Car{public:…
Q: Create parent class Shapes with protected parameters width and height and function printarea() and a…
A: A pure virtual function is sometimes called an abstract function, and a class with at least one pure…
Q: Write a C++ program to check for the not-eligible donor by throwing a custom exception. Strictly…
A: main.cpp Donor.cpp
Q: ll classes must be declared inside of the main function A) True B) False
A: Solution is given below :
Q: Class: A class in C++ is the building block that leads to object-oriented programming. true or…
A:
Q: 8. Identify and write non-static void methods with parameters correctly within a program considering…
A: Logic:- non static void methods are the methods which are declared without static keyword and it is…
Q: Answer only one question: 1- Write a C+ class and choose any name for it. The class should have two…
A: As per our guidelines, we are supposed to answer only one question. Kindly repost the remaining…
Q: Write a C++ program which will perform the following operations: • Define a class with name Car and…
A: Here I have created a class named Car with 4 data members as defined in the question. After that, I…
Q: Write a program in Java to perform the followings, (i) Design one parent and two child classes.…
A: We will write Java code to solve this problem.
Q: PROGRAMMING LANGUAGE: C++ I need the code for clockType.h , clockTypelmp.cpp , main.cpp…
A: Given Instructions :- This chapter defines the class clock-type to implement time in a program. Add…
Q: Write a C++ program to collect the donor details and to display them. Strictly adhere to the…
A: main() function is the entry point of any C++ program. It is the point at which execution of program…
Q: Write a C++ program that asks the user to enter the number of rooms in a house. For each room, the…
A: ALGORITHM:- 1. Take input from user. 2. Create the Room object. 3. Call the overloaded + operator…
Q: In C++ Language using Functions and Pointers PROBLEM: Consider the elevator in the Faculty of…
A: The program is written in C++. Check the program screenshot for the correct indentation. Please…
Q: Write a C++ class and choose any name for it. The class should have two private members and two…
A: The code in C++ has been given in step 2.
Q: 1. Write a c++ program that uses alone and constructors that has a class staff having fields:…
A: A member function of a class that initializes class instance objects is known as a constructor. When…
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- PROGRAMMING LANGUAGE: C++ I need the code for clockType.h , clockTypelmp.cpp , main.cpp CLOCKTYPE.H code provided in this exercise [EVALUATE THE GIVEN CODE AND PROVIDE THE CORRECT CODE] class clockType { public: void setTime(int, int, int); void getTime(int&, int&, int&) const; void printTime() const; void incrementSeconds(); void incrementMinutes(); void incrementHours(); bool equalTime(const clockType&) const; private: int hr; int min; int sec; };Code in C# (OOP Concept) Do a program that does the following: Ask for a number from the user in the main method o Pass thenumber to a method call it "Multiplication”. In the Method Multiplication, multiply the number by a number enteredby the user (mention that the number should be positive). Send the result back to the main and print it from the mainModify the previous program if the user enters a negative second number in the method Multiplication, do not acceptthe number and ask the user to reenter it again. . Add another method call it also Multiplication Ask for a float numberfrom the main and send it to the new Multiplication. This method should also ask for another positive number fromthe user and multiply it by the float number. Design and implement a function called "multiply" in C++ that accepttwo numbers and returns either the arithmetic multiplication or repetition of a given string a specific number of timesdepending on the data types of the argument values. The…basic java please Write a method dominant that accepts three integers as parameters and returns true if any one of the three integers is larger than the sum of the other two integers, otherwise it returns false. The integers might be passed in any order, so the largest value could be any of the three. If no value is larger than the sum of the other two, your method should return false. For example, the call of dominant(4, 9, 2) would return true because 9 is larger than 4 + 2. The call of dominant(5, 3, 7) would return false because none of those three numbers is larger than the sum of the others.
- In C++ Language using Functions and Pointers PROBLEM: Consider the elevator in the Faculty of Engineering (5 storey). Write a program which accepts the floor number where a passenger (student/faculty/other personnel) will ride the elevator. The passenger can then input the target destination floor. SPECIFICATIONS: Implement the class diagram below: Inside the main method, create an instance of the class Elevator. Use the goUp or goDown methods to generate the program display.Passenger can ride in any floor (1,2,3,4 or 5). Program will prompt the user with the target destination floor. After the user input: Program will display the floors which the elevator passes through, and finally the destination floor. Elevator will not move if the input for destination floor is the same as the present floor. Program will notify the user and then terminate. Program will also terminate if the input destination is not 1,2,3,4 or 5. You’re free to format the input/output display. Observe proper…In C#, how would you write (2) programmer defined methods as described below: Method #1 (GreetingGeneric) — a type void programmer defined method does not require any parameters. It should output a generic greeting line for a letter. For example: "Dear Customer", "Dear Student", etc. Method #2 (GradeMessage) — a type void programmer defined method that has (3) parameters; (string, string, double) for (name, assignment, and grade) and should output the passed parameters in sentence format: GradeMessage("Jimmy", "Midterm Exam", 79.5) would output: Jimmy took the Midterm Exam and got 79.5 points. The Main() method for this program should: call Method #1 to output the generic greeting ask the user to enter a name, assignment, and grade and pass them to Method #2 for output. Input should only be done in the Main() method and output in the programmer-defined methods.C++ Consider the following code: class A { public: virtual void printChar() { cout << 'A' << endl; } }; class B : public A { public: void printChar() { cout << 'B' << endl; } }; int main() { A a; B b; A *ptr; ptr = &a; ptr->printChar(); ptr = &b; ptr->printChar(); } Choose the best statement below: Consider the following code: class A { public: virtual void printChar() { cout << 'A' << endl; } }; class B : public A { public: void printChar() { cout << 'B' << endl; } }; int main() { A a; B b; A *ptr; ptr = &a; ptr->printChar(); ptr = &b; ptr->printChar(); } Choose the best statement below: a.) This code compiles, but has poor style. You shouldn't have a function printChar() defined in both classes. b.) This code compiles, and there is an example of polymorphism in the code. c.) This code compiles, and there is no example of…
- Asap. 4. Define a method in JAVA that should take 4 numbers as the parameters and returns the average of all the numbers. The function return type should not be void i.e. the average value should be returned by the function.write the code in c# Create a class with name savingaccont.In this class you have to write the static method having name CalculteFutureValue which takes three parameters of type double along with return type double.This function should implement the formula given below.The formula, which is known as the future value formula, is:F = P * (1 + i)tThe terms in the formula are as follows: F is the future value of the account after the specified time period. P is the present value of the account. i is the monthly interest rate . t is the number of months . Write Driver class which contains main function that prompts the user to enter the account’s present value, monthly interest rate, and the number of months that the money will be left in the account. The program should pass these values to a function named CalculteFutureValue that returns the future value of the account, after the specified number of months. The program should display the account’s future value.THIS IS FOR C# >>>>>>>>>>>>>>>>>>>>>>>>>THIS IS FOR C# Create a program named PaintingDemo that instantiates an array of eight Room objects and demonstrates the Room methods. The Room constructor requires parameters for length, width, and height fields (all of type int); use a variety of values when constructing the objects. The Room class also contains the following fields: Area - The wall area of the Room (as an int) Gallons - The number of gallons of paint needed to paint the room (as an int) Both of these values are computed by calling private methods. Include read-only properties to get a Room’s values. A room is assumed to have four walls, and you do not need to allow for windows and doors, and you do not need to allow for painting the ceiling. A room requires one gallon of paint for every 350 square feet (plus an extra gallon for any square feet greater than 350). In other words, a 12 x 3 x 10 room with…
- write the program in c# Create a class name Exponents and Write a function power(base , exponent) that takes 2 parameters of type ” int” that returns the value of base exponent. Base is nonzero positive integer while exponent is positive integer. Call this power method within function button_click of windows form class that reads integer values for base and exponent from user and performs the calculation written in the power method of Exponents class. If returned value is even it should display on label otherwise display it on textbox. Built-in functions are not allowed to use.(Assume label name lblDisplay and textbox name txtDisplay)Consider the following program written in C pseudocode void foo(int x, int y){ y = y + 9; X = X + y; } voidmain(){ int a = 6; int b = 5; foo(a, b); } For each of the following parameter-passing methods, what will be the values of a and b after running the program? Passed by value Passed by reference Passed by value-result 1. a= b= 2. a= b= 3. a= b=Instructions-Java Assignment is to define a class named Address. The Address class will have three private instance variables: an int named street_number a String named street_name and a String named state. Write three constructors for the Address class: an empty constructor (no input parameters) that initializes the three instance variables with default values of your choice, a constructor that takes the street values as input but defaults the state to "Arizona", and a constructor that takes all three pieces of information as input Next create a driver class named Main.java. Put public static void main here and test out your class by creating three instances of Address, one using each of the constructors. You can choose the particular address values that are used. I recommend you make them up and do not use actual addresses. Run your code to make sure it works. Next add the following public methods to the Address class and test them from main as you go: Write getters and…