Hello all,
i have a homework lab/assignment due by 12 tonight. It needs to print out a drawing panel and request 2 names from the user. It should then have a way to take the 2 names entered and create 2 new names in the drawing panel: e.i. "John" would be "Jo" and "hn" and "Mary" which would be "Ma" and "ry" creating "Jory" and "Mahn". Doesnt matter if the names make sense, it just needs to combine the 2. I need a total of 6 old names inputted by the user, and 6 new names that it should output in the drawing panel. Hope that makes sense but i cant figure how to get the names to split and combine to make the new names...help please...heres what i have so far but it has errors in it.
import java.awt.*;
import java.util.*;
public class Names {
public static void main(String[] args){
firstName();
secondName();
Scanner console = new Scanner(text);
DrawingPanel panel = new DrawingPanel (300, 300);
Graphics g = panel.getGraphics();
g.setColor(Color.WHITE);
drawString(OLD NAMES, 0, 0);
}
public static void firstName(char name1) {
System.out.println("Enter the first name: ");
name1 = console.nextChar();
}
public static void secondName(char name2) {
System.out.println("Enter the second name: ");
name2 = console.nextChar();
}
}
Thanks