#include using namespace std%3; class fraction{ float d,s; public: fraction() { d=0; s=1%3B } fraction(int a, int b) { d=a; s=b; } void print() { cout<
Q: What is wrong with the following code? Why? How can you fix it? // Remove all the books which co...
A: There is at least one error in the given code; the sentence "booksList.remove(b);" is in the wrong l...
Q: How can I set the two-bit rounding control (RC) field of the FPU control word to 10 (round towards +...
A: Hi Dear!! Can you once try with this...
Q: Create an Algorithm Design A number divisible by 2 is considered an even number, while a number whic...
A: Pseudo code is an informal language code, which helps the person who is writing the code or the prog...
Q: necessary to describe VRAM.
A: We are going to understand VRAM in computers. VRAMs stand for Video Random Access Memory. Let's unde...
Q: We want to emulate that, too! Using a recursive function, make it so that we print the number we are...
A: #include <stdio.h>int n = 1; // global variablevoid snake_ladder(int start, int stop);int main...
Q: What Exactly Is Visual Computing?
A: Computing is the process of using computer technology to complete a given goal oriented task.
Q: What is a triplex cable and a duplex cable?
A: There are various types of cables present for providing solution to different kind of problems.
Q: #10 Storage multipathing is a feature where single LUN can be accessed through different paths. Draw...
A:
Q: Problem 8: Use the tableau algorithm to prove the validity of the following formula (you have alread...
A: Hi Dear!! Please give positive feedback!! it is valuable To prove the given propositional logic usi...
Q: Create a statement that displays the value of the letterGrade char variable in a message box.
A: Here, I have to provide a statement to the above question.
Q: What is the value saved after executing the following code? .data var1 WORD 1000h var2 WORD 2000h...
A: answer in next step -
Q: Given: Relation R = {(a,c), (b,c), (c,c)} and Set S = {a, b, c} %3D Complete Relation R to be Symmet...
A: Given: To make the relation R symmetric.
Q: In arcGIS pro how do you get data from a standalone table to show on a map? (which tools and steps t...
A: GDP per capita is a metric for determining a country's economic production based on the number of pe...
Q: Create a function to determine the total pledge amount for a project. Use the function in an SQL sta...
A: SQL stands for standard query language.It is a domain specific language used in programming and desi...
Q: Language: C++ A shell sort algorithm is a variation of insertion sort. Your task is to sort the arra...
A: Start Take the array of elements Sort them Print array of elements Print Stop
Q: cript pickanumber3.sh. The script will get a random number 1 - 100. Ask the user to pick a number. I...
A: Given : Name the script pickanumber3.sh. The script will get a random number 1 - 100. Ask the user ...
Q: Create a function named mat_operations() that takes in two matrices a input parameters it should: 1....
A: A flowchart is a diagram that contain process, system algorithm. Flowchart are to explain the flow h...
Q: long func (long x, long m, long n) { long result = 0; int p = 1; int g = 10 if ((x > m) && (x < n)){...
A: we have given the c code ,we have to rewrite the code and replace the if-else with 'goto' statements...
Q: What Exactly Is Global Memory?
A: Introduction: Data in global memory is visible to all threads in the program (including the host), a...
Q: What is the name of a data source-connected user interface control?
A: Introduction: With no code required, data source controls connect to and retrieve data from a data s...
Q: What is output? public enum TrafficLight {RED, YELLOW, GREEN} TrafficLight myLight; myLight = Traffi...
A: question 1: In the first code enum TrafficLight has three values that are RED , YELLOW GREEN. Since ...
Q: To inspect the File System (e.g. NTFS) of a partition/volume, we can use the following utility tool(...
A: Introduction: This page contains a collection of DOS commands, most notably those used on x86-based ...
Q: From the employee table, calculate the average compensation for each job category where the employee...
A: here is the the required SQL query as shown below :- SELECT -- columns to be retrieved JOB...
Q: Write simple fork() code to print child and parent values taken from user. Take two different values...
A: Introduction Write simple fork() code to print child and parent values taken from user. Take two dif...
Q: Create an instance of the Transcript class with a statement.
A: Creation of objects: A class is a collection of user-defined data structures that include fields, at...
Q: Convert the schematic to TinkerCAD. Please don't use arduino.
A: Circuit is simulated in TinkerCAD
Q: Assume that all the course syllabus in your working directory are named by a major çode of three alp...
A: Given :- Assume that all the course syllabus in your working directory are named by a majorcode of t...
Q: Consider the WAN, or wide-area network, as your preferred wireless access method. What makes this op...
A: Internet is a Wide area network or simply a global network, which helps in supplying a number of ser...
Q: ####### in python ########## Calculate the approximate solution of th system of equations. xy = (z^2...
A: Python Code We can get the L¹ norm using the linear algebra module of the Numpy package which offers...
Q: 17. Remove all occurrences of given key of linear linked list.
A: The elements inside a LinkedList are iterated using an iterator and with this we can check the eleme...
Q: Given the following code entered in the IDL shell: >>> names = ["Dancer", "Prancer", "Vixen", "Rudy"...
A:
Q: What does it imply to claim that two items have a "is a" relationship?
A: Inheritance is the process through which one class inherits the properties of another. A child class...
Q: If you mistakenly delete a file and want to recover it, you must do the actions outlined below.
A: Introduction: The following are the steps to recover a deleted file on a Windows 10 computer using a...
Q: What is wear leveling and why is it important for solid-state drives?
A: Wear levelling (also known as wear levelling) is a method for extending the life of erasable compute...
Q: Which statement about counter variables used in program loops is correct? The counter variable shoul...
A: The correct answer is
Q: keyboard to press more when you hold down Value in "Current" tab;
A: The Python interpreter works by loading a source file or reading a line typed at the keyboard, parsi...
Q: 5.21.1: LAB: Countdown until matching digits python code: x=int(input()) if x>=11: count=11 ...
A: I have updated the code and now it produces the correct output, please refer to the answer section f...
Q: Explain what the stack pointer register is and what it does in a few words.
A: Given: Explain what the stack pointer register is and what it does in a few words
Q: What is the significance of architecture? Consider a project and map it both without and with archit...
A: Introduction: As we all know, software architecture is the mapping of strategic needs to architectur...
Q: Explain how to connect a computer to network
A: Computers connect and communicate with one another using the internet. To connect a computer to a ne...
Q: Let T:V>V be the adjacency operator of the Petersen graph as illustrated in the enclosed file. Here ...
A: the answer is an given below :
Q: Consider the following code: def test(*x): for k in x: print(type(k)) what will be the output if tes...
A: type is built in function in python programming which is used to get the datatype of passed argument
Q: What is the significance of the Log Output line?
A: In a programmer's arsenal, logging is an extremely useful tool. It can aid in the development of a b...
Q: b-) Convert the following instruction to machine code in decimal. (No need to convert it to binary) ...
A: Solution:-
Q: What component does an application use instead of dealing directly with the database
A: what components does an application use instead of dealing directly with the database
Q: Is there a way to rewrite this Java code differently? package application; public class Empl...
A: Answer: In this question, we are given a code and have to write in different possible if exist.
Q: a. log log log(n) b. nº log(n) c. 4.5(m) d. 3(m) e. n4log(n) f. log log(n) g. 4.5n + log(n)
A: Here in this question we have given some function and we have asked to arrange them in increasing or...
Q: 3. In the C++ language, write a function that takes a vector as the parameter and reverses the vecto...
A: In the C++ language, write a function that takes a vector as the parameter and reverses the vector. ...
Q: Write a C++ program that computes for the sum, difference, product, and quotient of two floating-poi...
A:
Q: Which of the following four sets of statements will legally compute x + 3(y+7z) and put the result i...
A: There are 3 types of 8086 Instructions Data movement between memory and register (leaq, movq) Arith...
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Step by step
Solved in 2 steps with 1 images
- Problem (Circle.java) Implement a class called Circle for representing a circle. The circle has two data members, a Point object representing the center of the circle and a float value representing the radius. Include appropriate constructors for your Circle class. Encapsulate it. Also include methods for finding the area and circumference of the circle. area = pi * radius * radius circumference = 2 * pi * radius. (You may use the static constant pi in the Math class) 5. Override the toString() and equals().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…JAVAclass: Main.java, Quadratic.java, TestQuadratic.java Create a class called Quadratic for representing a one-variable quadratic expression of the form: ax2 + bx + c a,b and c here are the coefficients. The class should contain the following methods: * A constructor that accepts values for a, b, and c. * public double getA() * public double getB() * public double getC() * public double evaluate (int x) * will return the value of the expression at point x * public double discriminant() - that will return (b2 - 4ac) * public boolean isImaginaryRoots() - roots are imaginary if (b2 - 4ac) < 0 * public boolean isRealRoots() - roots are real if (b2 - 4ac) >= 0 // these methods can only be invoked if the roots are not imaginary * public float firstRoot() * public float secondRoot() * public boolean isPerfectSquare(); // If the first and second roots are equal * Try to override the toString methods * Write a sample main program that will work as shown below. Example output:…
- C++ simple friend function.Create a C++ class called cube that calculates the volume of a cube. Use appropriate accessors (getters) and mutators (setters), constructors, etc. Your program must also include a friend function that will sum the volume of two cube class instances.Output the individual volumes of each of the two cube classes and then the total volume from the friend function. Example of friend funtion #include <iostream> using namespace std; class Box { double width; public: friend void printWidth( Box box ); void setWidth( double wid );}; // Member function definitionvoid Box::setWidth( double wid ) { width = wid;} // Note: printWidth() is not a member function of any class.void printWidth( Box box ) { /* Because printWidth() is a friend of Box, it can directly access any member of this class */ cout << "Width of box : " << box.width <<endl;} // Main function for the programint main() { Box box; // set box width…Term by CodeChum Admin (JAVA CODE) Construct a class called Term. It is going to represent a term in polynomial expression. It has an integer coefficient and an exponent. In this case, there is only 1 independent variable that is 'x'. There should be two operations for the Term: public Term times(Term t) - multiplies the term with another term and returns the result public String toString() - prints the coefficient followed by "x^" and appended by the exponent. But with the following additional rules: if the coefficient is 1, then it is not printed. if the exponent is 1, then it is not printed ( the caret is not printed as well) if the exponent is 0, then only the coefficient is printed. Input The first line contains the coefficient and the exponent of the first term. The second line contains the coefficient and the exponent of the second term. 1·1 4·3 Output Display the resulting product for each of the test case. 4x^4In C# using an array Implement the inventory manager class. This class must have methods that do the following: Add a new item to the inventory manager. Remove an item from the inventory manager. Re-stock an item in the inventory manager. Display the items in the inventory manager. Search for an item in the inventory manager by at least two criteria (name, price, quantity, etc.). Test the inventory manager class with a driver program or unit tests. This may be a console application.
- Topical Information Use C++. This lab will help you practice with dynamic memory (NOT mixed with classes). Program Information Heat flow through a rod can be simulated fairly easily in a computer program. We can simulate the rod using an array of temperatures. The rod begins all at the same temperature (user determined), but holding some position(s) of the rod at constant temperature (holding a match or ice cube to the rod) provides a [set of] heat source(s) (or sink(s)). To update the temperature at each time step (second?), you take the average of the positions on each side from the previous time step (and at the current position). For instance, if the following was the initial state of the rod: +------+------+------+------+------+------+------+------+ | 10 | 10 | 10 | 10 | 10 | 10 | 10 | 10 | +------+------+------+------+------+------+------+------+ And then the user specifies that there is a heat source at the left end of 100 degrees:…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 perimeterC++ simple friend function. Create a C++ class called cube that calculates the volume of a cube. Use appropriate accessors (getters) and mutators (setters), constructors, etc. Your program must also include a friend function that will sum the volume of two cube class instances. Output the individual volumes of each of the two cube classes and then the total volume from the friend function.
- In C++ Create a class called Pencil. Pencil has a type. Create another class called Customer. The customer class should have a ID number, array (using pointers) called purchases, and a Pencil variable. Make sure to create the purchases array in the constructor. Create a function to fill in purchase amount. Create a way to output all the information about a customer, including all the details about their type of pencil.c++ Friend function concepts Do not use operator overloading Write a Program to design a class complex to represent complex numbers and an input method "void input(float X, float Y)" for setting the values of complex number. Class should use an external friend function "friend complex sum (complex, complex);" to add two complex numbers and should return an object of type complex representing the sum of two complex numbers. Write another method "void show (complex c)" to show the final summation.Language: JAVA Keep Guessing Write a program that plays a number-guessing game to guess a secret number randomly generated within the range 1 and 10. The user will get as many numbers of tries as he/she needs to guess the number. Tell the users if their guess is right or wrong and if their guess is wrong let them try to guess the number again. You must generate the secret number using the Java Random class. When the user guesses a number he/she will have to take an input of his guessed number from the keyboard. The user will have to take as many inputs as needed to guess the correct secret-number. That means the code will keep looping as long as the guess is different from the secret number. Use a while loop to prompt the user to guess again if the guess is wrong. Create a class named NumberGuessingGame which will contain the main method, write all your code in the main method. Sample input and output: Suppose the random number generated is 6. I have chosen a number between 1…