Computers and Technology
Computers and Technology, 24.04.2020 19:54, chops85

I AM IN NEED OF HELP AND CANT DO COMPUTER SCIENCE TO SAVE MY LIFE PLEASE HELP!
ArrayList Card Collector

Directions: SHOW ALL YOUR WORK. REMEMBER THAT PROGRAM SEGMENTS ARE TO BE WRITTEN IN Java.

Notes:
Assume that the classes listed in the Quick Reference have been imported where needed.
Unless otherwise noted in the question, assume that parameters in method calls are not null and that methods are called only when their preconditions are satisfied.
In writing solutions for each question, you may use any of the accessible methods that are listed in classes defined in that question. Writing significant amounts of code that can be replaced by a call to one of these methods may not receive full credit.

Consider this implementation of the class Card, that stores information related to a cards monetary value, name, condition, and number in a set of collectible cards:

public class Card
{
private double value;
private String name;
private int setNum;
private String condition;

public Card (String Name, String Condition, double Value, int numSet){
name = Name;
condition = Condition;
value = Value;
setNum = numSet;
}

public String getName(){
return name;
}

public String getCondition(){
return condition;
}

public double getValue(){
return value;
}

public int getSetNum(){
return setNum;
}
}

QUESTIONS :

A subsequent class CardCollection has been created with the instance variable ArrayList collection that stores a collection of cards. When instantiated, the CardCollection class takes an ArrayList as a parameter, and copies that ArrayList to the Collection instance variable. In this question, you will write three methods in the CardCollection class.

A) Write a method totalValue() which returns the total value of all cards in a card collection.

B) Write a method checkPerfect() that prints the name of the Cards in a collection that are in "perfect" condition.

C) Write a method orderNumerically() that reorders the ArrayList collection in numerical order by set number. Assume that the set includes 151 cards.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 17:00, juandguardado7045
Your company has 1,500 desktop computers running windows 7. you want to upgrade them to windows 10. which type of microsoft license would be best suited in this situation?
Answers: 3
image
Computers and Technology, 24.06.2019 21:40, justintintran
Assume you need to test a function named inorder. the function inorder receives three int arguments and returns true if and only if the arguments are in non-decreasing order: that is, the second argument is not < the first and the third is not < the second. write the definition of driver function testinorder whose job it is to determine whether inorder is correct. so testinorder returns true if inorder is correct and returns false otherwise. for the purposes of this exercise, assume inorder is an expensive function call, so call it as few times as possible!
Answers: 1
image
Computers and Technology, 25.06.2019 10:20, lydialinton23
Write a program that lets the user play the game of rock, paper, scissors against the computer. the program should work as follows. 1. when the program begins, a random number in the range of 1 through 3 is generated. if the number is 1, then the computer has chosen rock. if the number is 2, then the computer has chosen paper. if the number is 3, then the computer has chosen scissors. (don’t display the computer’s choice yet.) 2. the user enters his or her choice of “rock”, “paper”, or “scissors” at the keyboard. (you can use a menu if you prefer.) 3. the computer’s choice is displayed. 4. a winner is selected according to the following rules: • if one player chooses rock and the other player chooses scissors, then rock wins. (the rock breaks the scissors.) • if one player chooses scissors and the other player chooses paper, then scissors wins. (scissors cuts paper.) • if one player chooses paper and the other player chooses rock, then paper wins. (paper wraps rock.) • if both players make the same choice, the game must be played again to determine the winner. be sure to divide the program into functions that perform each major task. include the code and the console output from running your program with test inputs in your report.
Answers: 3
image
Computers and Technology, 25.06.2019 12:50, mmaglaya1
Which of the following activities is an example od gathering data by observation
Answers: 3
Do you know the correct answer?
I AM IN NEED OF HELP AND CANT DO COMPUTER SCIENCE TO SAVE MY LIFE PLEASE HELP!
ArrayList Card...

Questions in other subjects: