- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
So I am confused as to how to generate random integers between a range, in the first one it says to make the range from 0 to n-1 and the precondition is that n has to be greater than 0. For the second import java.util.Random ; /** * This class … |
|
So I am having trouble knowing what to return in the bottom method any help would be appreciated . Here are the specifications for completing the StringArray class: (a) In the class StringArray write method numInArray,using the method signature below. numInArray should return the number of times the string s … |
|
So I have a project with a tester that is not displaying what I thought it would display. The project description and everything is as follows: Given an array of integers, how can we make some basic statistical calculations on the data? Specifically, we want to be able to determine … |
|
So I am having trouble with the last bit of the car class, I have to update the number of gallons in the car based on the number of miles driven... public class Car { private double mpg; private double mileage; private double tankCapacity; private double gasInTank; /** Constructs a … |
|
Alright so I have a tester for this class and it keeps saying this message: "Now testing your drive method: *** A car with mileage of 700 miles driving 400 miles before running out of gas should not now have mileage of 1700.0 miles" However when I remove the mileage … |
|
So I am simplifying fractions for my fractions class and I am having trouble with the euclidian code for the gcd, it also doesn't print to the console window it just runs and nothing happens: public class GCD { public static void main(String[]args) { int n = 5 ; int … |
|
HI, so my code compiles but does not give the result I intended. Any help is greatly appreciated! How can we count the number of occurrences of a character or group of characters (a substring) inside of a given string of characters? In other words, how can we count the … |
|
HI, so my code compiles but does not give the result I intended. Any help is greatly appreciated! public class SubstringCounter { public static int substringCounter(String master, String substring) { int count = 0 ; for(int pos = 0 ; pos < master.length() ; pos++) { int index = master.indexOf(substring, … |
|
So when I run my code I get a bug where it doesn't display the name for the person when displaying the scores: ![Screen_Shot_2017-10- ![Screen_Shot_2017-10-22_at_8_55_08_AM.png](/attachments/large/4/db8f249841da73d8654d7c6ea699aa03.png "align-center") Here is my code, I have been stumped for several hours: import java.util.Scanner ; public class StudentApp { public static void main(String []args) { … |
|
So I get an error that says "no suitable constructor found for Student(no arguments constructor)" /** * Write a description of class Student here. * * @author (your name) * @version (a version number or a date) */ public class Student { private String name ; private int test1 ; … |
|
import java.util.Scanner; public class LuckySevens { private int diceLength; private int rolls; private int sides; private int numRolls = 0; public static void main (String [] args) { Scanner reader = new Scanner(System.in); int diel, die2, dollars, count, maxDollars, countAtMax; System.out.print("How many dollars do you have? "); dollars = reader.nextInt(); … |