top of page
Legion of Learners
www.lol-101.com
Home
Classrooms
Courses
About Us
Executive Team
Our Mentors
Board Members
Resources
Members
More
Use tab to navigate through the menu items.
Log In
Forum Comments
7/29 Homework: Graphs
In CS Fundamentals for ACSL
edwin.li
Jul 30, 2020
0
0
Class 2 hw 5/24
In Java Question Bank
edwin.li
May 29, 2020
I did not finish but here is what i did work on import java.util.*; class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); ArrayList coordArrayListX = new ArrayList(); ArrayList coordArrayListY = new ArrayList(); boolean bob = true; while(bob == true) { System.out.println("Please enter a X value of a coordinate to place in the graph: "); int coordX = scan.nextInt(); coordArrayListX.add(coordX); System.out.println("Please enter a Y value of a coordinate to place in the graph: "); int coordY = scan.nextInt(); coordArrayListY.add(coordY); System.out.println("Continue with the amount of coordinates?(yes or no): "); String question = scan.next(); if (question.equals("yes")){ bob = false; } else{ bob = true; } } int[] coordListX = coordListXArray.toArray(); int[] coordListY = coordListYArray.toArray(); int smallestX = 0; System.out.println("Here is the list of coordinates!: "); //will delete later System.out.println(coordListX); System.out.println(coordListY); int coordListXLength = coordListX.length; int a=0; while(a<coordListXLength){ smallestX = coordList[0]; nextNum = coordListX[a]; a++; if (nextNum < smallestX){ smallestX = nextNum; } else{ continue; } System.out.println(smallestX); } } }
0
0
E
edwin.li
0
Followers
0
Following
More actions
Profile
Forum Comments
Forum Posts
More
Use tab to navigate through the menu items.
bottom of page