void fun(int i) { do { if (i % 2 != 0) cout <= 1); 1. cout << endl; } int main() { int i= 1;
Q: 3. String Reverser Write a recursive method that accepts a string as its argument and prints the…
A: Write a recursive method that accepts a string as its argument and prints the string in reverse…
Q: Provide the equivalent UML Diagram for this code.
A:
Q: public void Unknowno { if (size aur head; Node prev tail: fortint i-0; i< size/2: +) prov d
A: Given :
Q: Consider the following C program void fun(void) int a, b, c/* definition 1/ while C.J int b, c, d;…
A: Please find Re-vised code below:
Q: Cartesian Product Programming challenge description: The Cartesian product of two lists of numbers A…
A: The solution to the given problem is below.
Q: Mixed Fraction Arithmetic Java Project: Problem Description: Make a java program that facilitates…
A: It is defined as programs can be asked from control statements, array, string, oops etc. Java basic…
Q: Explain override equals() method
A: The answer with theory, coding and output screenshot is given below
Q: include using namespace std; struct Item{ int data; Item *next; }; class Stack{ private: Node…
A: We need to complete the given functions, and call each function in the main() to test if they are…
Q: Hi, I need to write this without using recursion. I am learning Dr. Racket, not phyton. I can use…
A: DrRacket is an integrated development environment (“IDE”). Much like any other IDE, we can download…
Q: Please use java Part 2. Library Class Implement a class, Library, as described in the class diagram…
A: As per the requirement program is completed. Algorithm: Step 1: Declare the required variables Step…
Q: I need help in this question of C Programming dealing with structs Structs given struct DateTag{…
A: The following solutions are
Q: In this assignment we will work on the creation of a poker game. At a minimum your game must deal 2…
A: Answer
Q: Population Count Description: The population count is the number of 1s (ones) in the binary…
A: Write a Java program to input the population(a non-negative integer) from the user and count the…
Q: 7. Dynamic MathStack The MathStack class shown in this chapter has only two member functions: add…
A: C++ language has an STL library (Standard Template Library) which is having built-in libraries for…
Q: The expression Branch (Tip 1) (Tip 2) is a value of the datatype: Odata Tree = Tip Tree | Branch Int…
A: First option is wrong: because you may specify a function Object() { [native code] } to be an infix…
Q: Public class Utilities { getDigits Method: public static java.lang.String…
A: Program code: //define a class Utilities public class Utilities { //define a variable index static…
Q: blem that the application must solve the application must use arrays loops inheritance constructors…
A: Below java console application about any valid problem that the application must solve the…
Q: Problem specification: In this assignment, you will search for a word in square sized grid of…
A: import java.util.Scanner; public class Puzzle { public static void main(String[] args){…
Q: Given the above parameters, implement a function that returns a string representing the plant (see…
A: Start. Use loop to print the character for 25 times. Declare the plant function to pass the…
Q: . Card Flipper: You walk into a room, and see a row of n cards. Each one has a number x; written on…
A:
Q: Bulgarian solitaire def bulgarian_solitaire(piles, k): You are given a row of piles of pebbles,…
A:
Q: It is advised to include a description of the GetConsoleTitle function.
A: GetConsoleTitle Function The GetConsoleTitle function can be used to return the name or the title of…
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: Transcribed Image Text JAVA Programming Problem: In the game of "Assassin's Creed", you control a…
A: As per the given problem statement we are required to develop a JAVA program to output the number of…
Q: Drag and drop the C++ statements to their proper order. Make sure you use proper indentions. Drag…
A: The correct sequence is I printed below as you didn't show were to drag and drop so I can't clearly…
Q: def bridge_hand_shape (hand): In the card game of bridge, each player receives a hand of exactly…
A: Required:
Q: 1- Entry Controlled loops: In this type of loops the test condition is tested before entering the…
A: Given few statements The given statements are true or false is discussed below.
Q: Create an iterator that returns numbers, starting with 1, and each sequence will increase by one…
A: Solution in C++- #include <iostream>using namespace std;void interater(){ for (int i =1;…
Q: #in c++ We need to store information about each student in a class of N students. For example, name,…
A: PROGRAM EXPLANATION: The algorithm for creating the program with given description is as follows:…
Q: oop using c++ please give me full answer thanks Write a Program that implements Base class…
A: Program description: n1 and n2 are the user input float variables of the class calculator. get()…
Q: Divisibility Test A number x is said to be divisible by a number y if when x is divided by y (x%y)…
A: The C++ program is given by #include <iostream> using namespace std; class check { public:…
Q: Write a C program that calls a function, fib(), that implements the Fibonacci sequence on an initial…
A: C programming language is the basic programming language, It's easy to learn to program for…
Q: PYTHON CS1 PROBLEM (NO LOOPS) Define a recursive function that takes two strings str1 and str2 as…
A: The code will have the following steps: The two strings are inputted from the user, and their…
Q: C++ Create a Blackjack (21) game. Your version of the game will imagine only a SINGLE suit of…
A: Answer :
Q: string class in C++ comes with many methods which serve either as accessors or mutators. Choose T…
A: Introduction: An accessor method in computer programming is a method that retrieves private data…
Q: C++ Programming Activity: Deque Linked List Explain the flow of the main code not necessarily every…
A: Initially addFirst, addLast, remFirst, remLast are false tempnum, num, sum, count are declared as…
Q: ge its data in the form of software. Being a programmer you have been asked to create the following…
A: The above program is a code for student and faculty information storage and calculation of the…
Q: trict unknown and illogical code. Asking third times. Make sure of correct code.
A: I have re-write code below:
Q: 1- Entry Controlled loops: In this type of loops the test condition is tested before entering the…
A: Given few statements The solution is given below
Q: Mario owns a pizzeria. Mario makes all of his pizzas from 10 different ingredients, using 3…
A: This program is written in Python. Please correct the indentation as per the screenshot, if it's…
Q: Language is c++ Assignment 6 C: Minesweeper - Simplified. For many years, computers sold with the…
A: Algorithm: Start Read size of grid n Initialize an array 'a' of size n*n with '?' Generate 3 random…
Q: \int power (int base, int exponent); Define the recursive function power() that when invoked returns…
A: required:
Q: 3-The following pattern of numbers is called Pascal's triangle. 1 1 1 1 2 1 1 3 3 1 4 6 4 1 The…
A: Answer If you adjust the tabulation slightly, you can see the solution more easily: The function…
Q: The operator used for dereferencing or indirection is
A: Correct answer is *
Q: Drag and drop the C++ statements to their proper order. Make sure you use proper indentions. Drag…
A: The Answer is in step2
Q: by CodeChum Admin (JAVA CODE) Construct a class called Term. It is going to represent a term in…
A: According to the Question below the Solution: Output:
Q: 1. Create the class implementation using Elevator C++ + upDirection 2. Create one object from class…
A: Program: //include the required header files #include <iostream> #include<string> using…
Q: int A -1: int B-2; ((A--1) <<"This 11 (B-- exam wa
A: Solution -In the given question, we have to find the output of the given c++ block.
Q: Prefix Calculator An arithmetic expression is in prefix form when operators are written before their…
A: Given:
Step by step
Solved in 2 steps with 1 images
- Use java programming language 1.1 Create a Student Object project. Create a Student class and use the provided UML diagram to code the instance fields, constructors and methods. Note: The module mark is the average of the participation mark and the examination mark - calculate this using the calcModuleMark() method. The determineStNumber() method should compile a student number with the first 3 letters of the student's name, a '#' symbol, and a 3-digit randomly generated number (make use of a for-loop to concatenate these 3-digits). The stNumber data field should be set in the constructor by calling the determineStNumber() method. The toString() method must compile a string to display the student number, participation mark, examination mark, and module mark, formatted in table format. Student number PMark EMark MMark Mar#9186 81 64 72.00 1.2 Create a testStudents class. Do the following: -Write a static method called display() which receives…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().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^4
- Object-oriented programmingProgram the employee class as indicated in the diagramTo calculate the salary, just multiply the number of hours by the payment per hour.The capture method asks the user for the data for the three attributes, asks for the hours worked and the payment per hour and with these data calculates the salary.The show method displays all of the employee's data.Do not forget the getter and setter methods only for attributes of type privateYour company has 7 employees and you would like1. Capture the data of each employee2. Show the data of each employee3. Show the data of a particular employee4. Calculate and display the average salary5. Calculate and display the name of the employee with the highest salary6. Calculate and display the name of the employee with the lowest salary7. Calculate and show the total payment you will make for all your employeesJAVAclass: 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:…It is convention that all metmber variables in a Java class are declared to have_____ access so they are not accessible outside the class.
- java programming Design a class named Complex for representing complex numbers Include methods add, subtract, multiply, divide, and abs for performing complex-number operations Override toString method for returning a string representation for a complex number. The toString method returns (a + bi) as a String. If b is 0, it simply returns a. Your Complex class should also implement Cloneable and Comparable. Compare two complex numbers using their absolute values. Provide three Constructors: Complex(a, b), Complex(a), and Complex() . Complex() creates a Complex object for number 0 Complex(a) creates a Complex object with 0 for b. Also provide the getRealPart() and getImaginaryPart() methods for returning the real part and the imaginary part of the complex number, respectively. (2) Draw the UML class diagram and implement the class. (3) Write a Test program Prompt the user to enter two complex numbers Displays the result of their addition, subtraction,…Write definition for a class named circle with attributes center and radius, instantiate circle object that represents a circle with its center at (125, 90) and radius 65 .write function named point_in_circle that takes a circle and a point and returns true if the point lies in or on the boundary of the circle , in c++ languageProblem (Circle.java)a. 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. a. Include appropriate constructors for your Circle class.b. Encapsulate it.c. Also include methods for finding the area and circumference of the circle. area = pi * radius * radiuscircumference = 2 * pi * radius. (You may use the static constant pi in the Math class)d. Override the toString() and equals().e. Write a simple main method that creates Circle objects and tests each of the methods that you have defined.
- A Person has a name (just a first name for simplicity) and friends. Store the names of the friends in a string, separated by spaces. Provide a constructor that constructs a person with a given name and no friends. Provide member functions. c++ void befriend(Person p) void unfriend(Person p) string get_friend_names()Part 2. Library Class Implement a class, Library, as described in the class diagram below. Library must implement the Comparable interface. The compareTo() method must compare the branch names and only the branch names. The comparison must be case insensitive. The equals() method must compare the branch names and only the branch names. The comparison must be case insensitive. Be sure to test the equals() and compareTo() methods before proceeding. Library - state: String - branch: String - city: String - zip: String - county: String - int squareFeet: int - int hoursOpen: int - int weeksOpen: int + Library(state: String, branch: String, city: String, zip: String, county: String, squareFeet: int, hoursOpen: int, weeksOpen: int) + getState(): String + getBranch(): String + getCity(): String + getZip(): String + getCounty(): String + getSquareFeet(): int + getHoursOpen(): int + getWeeksOpen(): int + setState(state: String): void + setBranch(branch: String):void +…In 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.