Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
0 Endorsements
~17.9K People Reached
Favorite Tags
java x 12
Member Avatar for Dietrich_1

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 …

Member Avatar for rproffitt
0
544
Member Avatar for Dietrich_1

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 …

Member Avatar for JamesCherrill
0
863
Member Avatar for Dietrich_1

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 …

Member Avatar for hericles
0
11K
Member Avatar for Dietrich_1

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 …

Member Avatar for JamesCherrill
0
873
Member Avatar for Dietrich_1

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 …

Member Avatar for stultuske
0
421
Member Avatar for Dietrich_1

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 …

Member Avatar for tinstaafl
0
183
Member Avatar for Dietrich_1

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 …

Member Avatar for JamesCherrill
0
448
Member Avatar for Dietrich_1

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, …

Member Avatar for JamesCherrill
1
356
Member Avatar for Dietrich_1

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) { …

Member Avatar for JamesCherrill
0
2K
Member Avatar for Dietrich_1

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 ; …

Member Avatar for tinstaafl
0
421
Member Avatar for Dietrich_1

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(); …

Member Avatar for rproffitt
0
648