This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.*; | |
import javax.swing.JFrame; | |
import java.util.Scanner; | |
public class aCircle extends Canvas | |
{ | |
public void paint( Graphics g ) | |
{ | |
Scanner kb = new Scanner(System.in); | |
g.setColor(Color.black); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class gridLines { | |
public void main gridLines(); | |
{ | |
int x = getWidth(); | |
int y = getHeight(); | |
int i = y; | |
int u = x; | |
for (i = 0; i <=10; i++) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Collatz | |
{ | |
public static void main (String []args) | |
{ | |
Scanner keyboard = new Scanner (System.in); | |
System.out.print("Give me a starting number: "); | |
int n = keyboard.nextInt(); | |
int even = n/2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//The program works but I don't want it to print the integers i, ii, iii,iiii. I think it's automatically printing then when it processes the compareTo. The assignment example has it not printing those integers. Any suggestions on how to stop that? | |
import java.util.Scanner; | |
public class AlphabeticalOrder | |
{ | |
public static void main (String [] args) | |
{ | |
Scanner keyboard = new Scanner(System.in); | |
String lastName = "What is your last name? "; | |
System.out.println(lastName); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class TwoMoreQuestions | |
{ | |
public static void main (String []args) | |
{ | |
Scanner keyboard = new Scanner(System.in); | |
String intro1 = "TWO MORE QUESTIONS, BABY!"; | |
String intro2 = "Think of something and I'll try to guess it."; | |
String question1= "Question 1) Does it belong inside or outside or both?"; |