Hello All, I have a problem with this code, I am trying to create a program that will allow sone integer values and strings to be entered and all stored in two array. So they all can be printed at the end of the program having something like this.
I intend to have input like the one below and the output follows; *//This is the input done by the user and then terminates with N First Number: 55875 Last String: Participate First String: Conjoured String Mode: Passing Required Jungle How Many Exams shall I calculate?: 4 Exam Number 1 : 45 Exam Number 2 : 32 Exam Number 3 : 85 Exam Number 4 : 40 Enter Latitude Mark: 52.12 Do You Want to Compute Another? Y / N ? Y First Number: 49602 Last String: Control First String: Structure String Mode: Passing Beyond Enemy Lines How Many Exams shall I calculate?: 2 Exam Number 1 : 65 Exam Number 2 : 40 Enter Latitude Mark: 60.04 Do You Want to Compute Another? Y / N ? N // Output will be here after storing all values Overall Entered for Participate Conjured With First Number: 55875 And String Mode: Passing Required Jungle Latitude Mark: 52.12 Overall Entered for Control Structure With First Number: 55875 And String Mode: Passing Beyond Enemy Lines Latitude Mark: 60.04* The code I worked with is this; In the code, I tried declaring the double way array so I will be able to store the values in two different ways. *import java.util.Scanner; public class JavaArray{ private static int firstint, intLatMak, noOfExam, b; private static String lastString, firstString, stringMode; private static double [][] JMark; public static void main(String[] args){ boolean fast=true; String test; Scanner in = new Scanner(System.in); for (b=0;fast;b++){ System.out.print("First Number: "); firstint = Integer.parseInt(in.nextLine().toString()); System.out.print("Last String: "); lastString = in.nextLine(); System.out.print("First String: "); firstString = in.nextLine(); System.out.print("String Mode: "); stringMode = in.nextLine(); System.out.print("How Many Exams shall I calculate?: "); noOfExam = Integer.parseInt(in.nextLine().toString()); JMark = new double [b][noOfExam]; for (int a=0; a<noOfExam; a++){ System.out.print("Exam number " + (a+1) +": "); JMark[b][a] = Double.parseDouble(in.nextLine().toString()); } System.out.print("Enter Latitude Mark: "); intLatMak = Integer.parseInt(in.nextLine().toString()); } System.out.print("Do You Want to Compute Another? Y / N ?"); test = in.nextLine(); if (test=="Y") fast=true; else fast=false; } } * Please I will really need your help on this or which ever way you think I can come around it. All suggestions will be highly welcomed and appreciated. Expecting to read from you all. -- DISCLAIMER This message contains privileged and confidential information and is intended only for the individual named. If you are not the intended recipient you should not disseminate, distribute, store, print, copy or deliver this message. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail and any attachments from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. Thank you -- Tope Olukosi -- To post to this group, send email to javaprogrammingwithpassion@googlegroups.com To unsubscribe from this group, send email to javaprogrammingwithpassion+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en