Complete the following
#include <iostream>
using namespace std;
class Yard
{
private:
int length, width;
public:
Yard()
{ length = 0; width =0; }
setLength(int len)
{ length = len; }
setWidth(int w)
{ width = w; }
};
int main()
{
// Finish this program
}
Want to see the full answer?
Check out a sample textbook solutionChapter 13 Solutions
Starting Out With C++ From Control Structures Through Objects, Student Value Edition (8th Edition)
Additional Engineering Textbook Solutions
Starting Out With Visual Basic (8th Edition)
Starting Out with C++: Early Objects
Computer Science: An Overview (12th Edition)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Programming in C
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
- Language: JAVA Script Your company is giving every employee earning less than $50,000 a 10% raise! *Write a function 'employeeRaises(peopleObj)' that takes an array of objects s containing employee names and their salaries and returns an array containing the employees that need raises, along with their new salaries. Example: employees [ {name: "Alice", salary: 80000}, {name: "Bob", salary: 48000 }, {name: "Carol", salary: 60000}, {name: "Dan", salary: 78000}, {name: "Ellen", salary: 100000}, console.log(employeeRaises (employees) ); // [ { name: 'Bob', salary: 44000 } ] funcation emplyeeRaises(employees){ |// Your code here} /****DO NOT MODIFY ANYTHING UNDER THIS LINE****/ try{| module.exports = employeeRaises;}catch (e) {|module.exports=null;}arrow_forwardQ 1) Write a class with name Array. This class has an array which should be initialized by user. Create a function with name sumFind in this class with working logic as sum of all elements of an array, after finding sum, if sum is even calculate factorial otherwise display only sum. ( Note::: subject::c# language )arrow_forwardStudent class is defined as follows. Class Student {int Number String Name} Using the “Student” class write a Java program that reads student’s data on the screen into one dimension array. List the data that you read in array. Test your program for 10 students and show the result list. Note: Just use one array.arrow_forward
- Question: Write a program to Simulate a game of tic tac toe. A game of tic tac toe has two players. A Player class is required to store /represent information about each player. The UML diagram is given below. Player -name: string -symbol :char Player (name:string,symbol:char) getName():string getSymbol():char getInfo():string The tic tac toe board will be represented by a two dimensional array of size 3 by 3 characters. At the start of the game each cell is empty (must be set to the underscore character ‘_’). Program flow: Your program must ask for each player’s name and their special symbol or character (usually an ‘X’ or ‘O’). Display each player’s name and symbol. The program must then display the board (the 2 dimensional array). The player whose turn it is has their name displayed and is asked for a row and column number to place their symbol. They can enter -1 -1 as the row and column number to quit. Repeat 2 and 3 until one player enters -1 -1. Your…arrow_forwardQuestion: Write a program with C# to Simulate a game of tic tac toe. A game of tic tac toe has two players. A Player class is required to store /represent information about each player. The UML diagram is given below. Player -name: string -symbol :char Player (name:string,symbol:char) getName():string getSymbol():char getInfo():string The tic tac toe board will be represented by a two dimensional array of size 3 by 3 characters. At the start of the game each cell is empty (must be set to the underscore character ‘_’). Program flow: Your program must ask for each player’s name and their special symbol or character (usually an ‘X’ or ‘O’). Display each player’s name and symbol. The program must then display the board (the 2 dimensional array). The player whose turn it is has their name displayed and is asked for a row and column number to place their symbol. They can enter -1 -1 as the row and column number to quit. Repeat 2 and 3 until one player enters -1 -1.…arrow_forwardCreate a class: “Question 1” with data members: 1D integer array of maximum size: 100, n(int). Create a dynamic constructor which takes input of n and n no. of array elements. Apartfrom taking input this class also displays the maximum and minimum elements from the givenarray elements.arrow_forward
- Complete the following program so it defines an array of Yard objects. The program should use a loop to ask the user for the length and width of each Yard.arrow_forwardWrite code for PersonManagement class. This class contains the array of Person class (code is given below) and also following methods:1. set: This method receives the array of person class and set the attribute.2. displayAll: This method will display values of all persons.3. sort: This method will sort the array according to age values of the persons with ascending order using Selection Sort.4. reverse: This method will reverse the order of the array.5. getPersons: This method will return the array of the persons (attribute).6. displayEvenAgePerson: This method will display all those persons values who have even age.7. displayOddAgePerson: This method will display all those persons values who have odd age.8. displayPrimeAgePerson: This method will display only those persons values who have prime number age.Following is the class of Person: public class Person {private String Name;public int age;public void set(String Name, int age){this.Name = Name;if(age > 0 && age <=…arrow_forward5.24 LAB: Shift right (JAVA) Write a program in java that reads a list of integers from input into an array and modifies the array by shifting each element to the right one position and by shifting the last element to the first position. The input begins with an integer indicating the number of values that follow. Output the modified array and end with a newline. Ex: If the input is: 6 2 4 6 8 10 12 the output is: 12 2 4 6 8 10 For coding simplicity, follow every output value by a space, including the last one. Code starts here: import java.util.Scanner; public class LabProgram { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int[] userValues = new int[20]; // List of integers from input /* Type your code here. */ }}arrow_forward
- Using oop in java Write code for PersonManagement class. This class contains the array of Person class (code is given below) and also following methods: set: This method receives the array of person class and set the attribute. displayAll: This method will display values of all persons. sort: This method will sort the array according to age values of the persons with ascending order using Selection Sort. reverse: This method will reverse the order of the array. getPersons: This method will return the array of the persons (attribute). displayEvenAgePerson: This method will display all those persons values who have even age. displayOddAgePerson: This method will display all those persons values who have odd age. displayPrimeAgePerson: This method will display only those persons values who have prime number age. Following is the class of Person: publicclass Person { private String Name; publicintage; publicvoid set(String Name, intage) {…arrow_forwardIn GO language. Create a struct that has student name, id, and GPA. Write functions to create a student, modify the student’s id, and modify the student's GPA, and print the student’s information. (This is like creating a class and methods). Now create an array of three students and test your functions. You may hardcode your values if using a web conpiler. (Please hardcode the values!)arrow_forwardTopic: pointers, dynamic array and command line arguments Write a complete C++ program named “showHelp” that accepts command line arguments. It checks whether there is a command line argument of “/help” or“/?” or “-help” followed by a topic number. It will print out “yes, topic number(<number>) if there is one. Otherwise, it prints out “no, topic number(N/A) For example, if you run this program with correct arguments as follows, it willprint out yes and its associated topic number respectivelyshowHelp /? 101showHelp /debug /help 102showHelp /print /help 103 /verboseshowHelp -verbose -debug -help And if you run the program with invalid arguments, it will print no, in all casesshowHelp -helpshowHelp 101 /?showHelp 101 102 /help /verboseshowHelp /? /help -helpNote: command line arguments are simply an array of pointers to C-string. example code: #include <iostream> using namespace std; int main(int argc, char** argv){...}arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning