Create a class called CustomerLister with a main method that instantiates an array of String objects called customerName. The array should have room for five String objects. Use an initializer list to put the following names into the array: Cathy Ben Jorge Wanda Freddie Print the array of names.
Q: reate a "Car" class that keeps car ids and prices. And create a "Galleries" class that holds the car…
A: The requirement is to create a linked list of node cars where the list will be considered as a…
Q: Write a public static method named printArray, that takes two arguments. The first argument is an…
A: public class Main{ public static void main(String[] args) { int[] myArray = {1, 22, 333, 400,…
Q: Implement all the classes. The formula for calculating salary for each class is shown below: For…
A: Below is the code in java and sample output:
Q: Write a class Employee with name and salary. Create an ArrayList that sorts the Employees based on…
A: import java.util.*; public class test { // Employee class that imlements comparable interface…
Q: Create a server class called Course and a class called Student Class Student a string called…
A: Given information, Given the class CourseDemo and the testing code. It is required to create the…
Q: Create a static method called createOrderArray. This function should take in a String as a parameter…
A: Here I have created an enum named order with the values as given in the question Then I have created…
Q: You’ve been given a list of books to read over the summer, but you only want to read the books by a…
A: public class Book{private String title;private String author;private int numPages; public…
Q: uestion) class Player: total_player = 0 def __init__(self,name,country):…
A: Design TennisPlayer class which inherit from Player class so that the following code provides the…
Q: Implement a class named Parade using an ArrayList, which will manage instances of class Clown. Each…
A: Implement a class named Parade using an ArrayList, which will manage instances of class Clown. Each…
Q: Array of objects) The array of Vehicles below, write the static method, findMin which returns the…
A: As you mentioned the array and want to find the minimum value from that array as the lowest price of…
Q: Modify the BookStore and BookSearchEngine classes explained in the class to include the following…
A: Code and Output start from step-2.
Q: write a class called rectangle that implements the Comparable The class should contain three fields:…
A: import java.util.*;//1. definition for Class Rectanglepublic class Rectangle implements…
Q: Given a base Plant class and a derived Flower class, complete main() to create an ArrayList called…
A: The ArrayList class is a resizable array that is present in Java. util package. While built-in…
Q: First create a class called StringHelper which has the following static methods meshStrings: This…
A: import java.util.Scanner;public class StringHelperTester { public static String…
Q: Consider the dass Account Aume the class is gen de not witn he cless metodal The Account class has…
A: Iterate over the given array and keep on adding them to new list which are having name starts with…
Q: A pet shop wants to give a discount to its clients if they buy one or more pets and at least five…
A: import java.util.Scanner; public class Pets { public static void discount(double[] prices,…
Q: This assignment creates a GradeBook class that manages a list of quiz grades, computes the average…
A: According to the information given:- we have to follow the instruction in order to get desired…
Q: 3. Write a method oddDice() that takes an array of Die objects as a parameter. The method rolls each…
A: Step 1 : Start Step 2 : In the Die class declare an integer member Die_Num. Step 3 : Define a method…
Q: Write a method named getMax that will take an array of doubles as a parameter, and it will return…
A: Answer
Q: Add a getUnsold method to the Auction class with the -following header: public ArrayList getUnsold()…
A: lots is a field in Auction class and also mentioned this Lot object will also have highestBid field…
Q: Need help writing the following method: getWaitlistedStudents() – returns an array of Students in…
A: From the sample code given, it can be seen that waitlist is a linked list of type students. To…
Q: Create an array of objects and initialize them and show the data using class methodsHint:( create…
A: A class is a user-defined data type that combines data members and methods for manipulating that…
Q: Write a class encapsulating the concept of converting integer grades to letter grades (A, B, C, D,…
A: class Test { public static void main(String[] args) { Grade grade1 = new Grade(50);…
Q: In this exercise, you are given a Food superclass and two subclasses, Fruit and Meat. These methods…
A: Program Food.java: public class Food { private String name; privateint calories; public Food(String…
Q: Create a MyTime class which is designed to contain objects representing times in 12-hour clock…
A: The classes are designed as per the requirement in the next step:
Q: Write a loop that computes the average of an array of integers called iArray that has been…
A: Write a loop that computes the average of an array of integers called iArray that has been…
Q: Question 1 public class Flat { private int noofRooms; private double area; private boolean seaView;…
A: public class Flat { private int noOfRooms; private double area; private boolean seaView;…
Q: Create a class called Student that models a student at Carleton University. A student's state…
A: package com.company;import java.util.Scanner;public class Main { public static void main(String[]…
Q: create an array of "Opinion" objects called "poll" that will represent five students opinions of a…
A: Note: In this question the coding language is not specified then we are doing this question in the…
Q: 2.write a method that receives an array of numbers and a key and returns true if the key exists in…
A: We need to write a method that receives an array of numbers and a key. And returns true if the key…
Q: The array of Vehicles below, write the static method,findMin which returns the lowest price of any…
A: A static method that returns the lowest price is as follows, Code: //Define the method public static…
Q: Create a new class called Numbers that contains a method called nextLargest. This method should…
A: The program for the above-given question is given below
Q: Create a MyTime class which is designed to contain objects representing times in 12-hour clock…
A: public class MyTime{ private String myTime; //instance variable //constructor that…
Q: Create the class Suitcase. Suitcase has things and a maximum weight limit, which defines the…
A: As per the requirement program is completed. Note: In the question programming language is not…
Q: You're at the ice cream store trying to decide what kind of ice cream and toppings you want. There…
A: An ArrayList is a type of array provided in Java. It is resizable and so as many items as required…
Q: CookBook Class In this exercise, you are going to complete the CookBook class. public class…
A: Answer: Here is the code : import java.util.ArrayList;import java.util.Iterator; public class…
Q: Implement a method named dieStats(). The method takes a two-dimensional array of Die objects, named,…
A: The code for the above-given question is given below:
Q: Need help writing the following method: getRegisteredIDs() – returns an array of int[], namely…
A: In order to implement the requirements, first we get the size of the course. Then we create an array…
Q: When you add a contact to your phone, it automatically sorts those names alphabetically. In this…
A: Given data addNumber- This method takes a PhoneNumber and adds it to the directory. Once the…
Q: Q1. Create a class called Sorter that has two static methods: public static void…
A: Answer:- /** * The java test program that calls the Sort class * bubblesort,insertion sort and…
Q: Challenge exercise Create a class called SortingTest. In it, create a method that accepts an array…
A: Since programming language not mentioned, using C++.
Q: Write a static method named createDigitsArray (int number) which takes a positive integer as a…
A: Write a static method named createDigitsArray(int number) which takes a positive integer as a…
Q: Create an object of type FitnessExperiment that stores an array of StepsFitnessTracker,…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: Write a class called BasicPricer. Your class should have the following: A private field called…
A: Below is the required code in java and sample output:
Q: We will write an Account class that represents a (simplified) bank account. A bank account keeps the…
A: Solution: Given, acc1 = Account('MUIC', 'A12345', 500)acc2 = Account('CS', 'A67890', 0)…
Q: You are being asked to create a (Comparable) data class Student that will be used to maintain…
A: The main function which actually takes the user input is placed under the StudentRecord Class.…
Q: Write a program which does the following: 1. Create a class with the main() method. 2. Take a string…
A: /*We cannot print a normal string array using Arrays.toString(), if we create a data type words[]…
Q: what is needed to be solved: Execute the rectangle class with some modifications: - add color…
A: Answer: Main.cpp: #include <iostream>#include "Rectangle.h"#include "Triangle.h" using…
Create a class called CustomerLister with a main method that instantiates an array of String objects called customerName. The array should have room for five String objects. Use an initializer list to put the following names into the array:
Cathy
Ben
Jorge
Wanda
Freddie
Print the array of names.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- The zoo will have several animals, and each animal will have a name, age, and species. Moreover, each animal will have a method make_sound(), which should return a string representing the sound it makes. Perform the following steps: Create a Zoo class. This class should be able to store multiple animals. It should have methods to add_animal and remove_animal. Also, add a method get_animals that prints a list of all animals currently in the zoo, including their name, age, and species. Create an Animal parent class. This class should have attributes for name, age, and species. Include a make_sound() method that returns a string representing the sound the animal makes. Create two or more child classes that inherit from Animal (for example, Lion and Elephant - you get to choose the animal types). These child classes should override the make_sound() method to return a sound specific to the animal they represent. Your program should be interactive. It should provide a menu to the user that…JavaDriver Program Write a driver program that contains a main method and two other methods. Create an Array of Objects In the main method, create an array of Food that holds at least two foods and at least two vegetables. You can decide what data to use. Method: Print Write a method that prints the text representation of the foods in the array in reverse order (meaning from the end of the array to the beginning). Invoke this method from main. Method: Highest Sugar Food Write a method that takes an array of Food objects and finds the Food that has the most sugar. Note that the method is finding the Food, not the grams of sugar. Hint: in looping to find the food, keep track of both the current highest index and value. Invoke this method from main.JAVA Include Code Comments create a public class named ArrayUtility In ArrayUtility class, create a public static method toString that receives an array of int's, a start string, a separator string and an end string. It returns a String starting with the start string, followed by the array elements separated by the separator and ending with the end string. create a public class named ArrayUtilityTest In ArrayUtilityTest class, create a public static method toStringTest that prints the results for the following 5 lengths of arrays, using different types of brackets and separators for each: empty, singleton, two elements, 5 elements and 20 elements. Call only this class in the main method and check the results. In ArrayUtility class, create a public static method equals that receives two arrays of int's and returns true if they have the same length and equal corresponding elements. In ArrayUtilityTest class, create a public static method equalsTest that prints the results for the…
- Create a class called WashingMachine with a float called CubicFeet, a string called brandName, and a method called Washing. The Washing method should return a string to the main class with the text "Now washing clothes!" In the main class create an array of WashingMachine size 5. Give each WashingMachine a different brand and CubicFeet. Use a foreach loop to display that info, call the Washing method, and display the text returned from the Washing method call. in C#Create a MagicalPotionShop class, this class needs a field called potions. The potions field should be an ArrayList of the type Potion. Create a MagicalPotion class, this class needs two fields one called name, the other called effect. Both of the fields should be Strings.Create a new class in the practicum1 package named ArrayUtilities. Write a method in the class that meets the following requirements: - It should be named "arrayToString" - It should declare a parameter for an int array. - It should return a String in the same format as the example above, e.g. "[1, 2, 3]". If the array is length 0, you should return the string "[]". - It should NOT use the Arrays.toString() method - you should create and return the string yourself. - You may receive a warning from IntelliJ about using string concatenation. You may ignore it. Write a main method to test your method by calling it with one or more small arrays and printing the string(s). Example output: [] [1, 2, 3] [2, 3, 5, 7, 11, 13]
- Python help please! Thank you! Add the following methods to your Boat Race class: Write a method called add_racer which takes in a Boat object and adds it to the end of the racers list. The function does not return anything. Write a method called print_racers which loops through racers and prints the Boat objects. This function takes in no parameters (other than self) and returns nothing. Write a method called count that returns the number of racers. Write a method called race. The race function calls the move function for all of the racers in the BoatRace. Once all the racers have moved, call the print_racers method to display information about the progress of each boat. Then, check if any of the racer’s current_progress is greater than or equal to the race’s distance. If so, then return a list of all of the racers whose current_progress is greater than or equal to distance. If no racer has finished the race then repeat the calls to move and check until at least one…Design an application that declares an array of 10 StockTransactionobjects. Prompt the user for data for each object, and then display all the values. Design an application that declares an array of 10 StockTransactionobjects. Prompt the user for data for each object, and then pass the array to a method that determines and displays the two stocks with the highest and lowest price per share.Add the following methods to your Boat Race class: Write a method called add_racer which takes in a Boat object and adds it to the end of the racers list. The function does not return anything. Write a method called print_racers which loops through racers and prints the Boat objects. This function takes in no parameters (other than self) and returns nothing. Write a method called count that returns the number of racers. Write a method called race. The race function calls the move function for all of the racers in the BoatRace. Once all the racers have moved, call the print_racers method to display information about the progress of each boat. Then, check if any of the racer’s current_progress is greater than or equal to the race’s distance. If so, then return a list of all of the racers whose current_progress is greater than or equal to distance. If no racer has finished the race then repeat the calls to move and check until at least one racer has finished the race.…
- Create a class called StudentBirthYear. It should only have two members, both of them arrays. One of type string called Names. The second of type int called BirthYears. Now in your main class create a StudentBirthYear object. Make sure both arrays are of the size 13. Add thirteen different names and thirteen different birth years. Then display each name with its birth year using only 1 for loop. Only use a for loop, no other kind of loop.1. Square Roots Create a class with a method that, given an integer, returns an array of double-precision floating point numbers (known in Java as double), each of which is a square root of a number between 2 and the parameter to the method. For example, if the parameter is 5, the method should return an array of 4 doubles, with approximate values 1.4142135623, 1.7320508075, 2.0, and 2.2360679774. Your method should check the validity of the parameter, and take appropriate action if the parameter is invalid. 2. Reading Files Create a class with a method that, given a string representing a file name, returns an integer with the number of characters in the file. For example, if the file has 10 characters, your method must return the number 10. 3. Main Class Create a class HW1.java with a main method that does both of the following: calls the method from part 1 with a random integer between 0 and 10, and prints each of the numbers in the result. The numbers should all be printed on the…Library class: Fields: books as arraylist to store all the books available in the library B3 B1 B2 В4 B5 Constructor: Library() } : No parameterized constructor to create the books object Methods: 1. addBook(Book bookobj): to add a new book to the arraylist; send the book object as a parameter to this method. 2. searchBook(String name): search a book by a given name in the arraylist. if exits print bookX found; otherwise print not found!!! 3. RemoveBook(String name): to delete a book object from arraylist by a given name: Hint: you need to use iterator class and remove method. Book class: Fileds: bookld, bookname. Constructor: two parameterized constructor that accepts name a parameter Book(int ID, String name) ..... Methods: 1. Accessor method to return the name of the book 2. Mutator method to change the id of the book. Use this Main method: in your program: public static void main(String args[]) { Library lib=new Library(); lib.addBook(new Book("b1")); lib.addBook(new Book("b2"));…