473,624 Members | 2,565 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Please Help due in 45 min

1 New Member
I need to write a program that reads this from the text file

Expand|Select|Wrap|Line Numbers
  1. 4
  2. Katea
  3. Murray
  4. 3.75
  5. 9
  6. Matt
  7. Reese
  8. 2.89
  9. 11
  10. Liz
  11. Huntley
  12. 3.98
  13. 12
  14. Ken
  15. Black
  16. 2.99
  17. 11
and puts it in a few arrays
grade
FirstName
LastName
Gpa

the program also needs a capability to search those arrays
// Search by first name
// Search by last name
// Search by Gpa

and to provide an overall Gpa average
and it needs to have a capabilty to add new students
please help

I already have the menu
Expand|Select|Wrap|Line Numbers
  1. public void menu()
  2.                {
  3.             char ch=30;
  4.                 char ch1=31;
  5.                 int l;
  6.                 for(int i=0;i<27;i++)
  7.                 {
  8.                   System.out.print(" ");
  9.                 }
  10.                 for(l=0;l<2;l++)
  11.                {
  12.  
  13.                 for(int j=0;j<38;j++)
  14.                 {
  15.  
  16.                   System.out.print(ch);
  17.                 }
  18.                   System.out.println("");
  19.                    for(int k=0;k<27;k++)
  20.                 {
  21.                   System.out.print(" ");
  22.                 }
  23.               }
  24.                 System.out.print(ch);
  25.                 System.out.print(ch1);
  26.                 for(int i=0;i<34;i++)
  27.                 System.out.print(" ");
  28.                 System.out.print(ch);
  29.                 System.out.print(ch1);
  30.                 System.out.println("");
  31.                 for(int i=0;i<27;i++)
  32.                 System.out.print(" ");
  33.  
  34.                 System.out.print(ch);
  35.                 System.out.print(ch1+" ");
  36.                 System.out.print (" 1. Enter new Students record           ");
  37.  
  38.                 System.out.print(" "+ch);
  39.                 System.out.println(ch1+" ");
  40.  
  41.                 for(int i=0;i<26;i++)
  42.                 System.out.print(" ");
  43.                 System.out.print(" "+ch1);
  44.                 System.out.print(ch+" ");
  45.  
  46.  
  47.             System.out.print (" 2. Display All Student records and GPA:         ");
  48.                 System.out.print(" "+ch);
  49.                 System.out.println(ch1+" ");
  50.  
  51.  
  52.                 for(int i=0;i<26;i++)
  53.                 System.out.print(" ");
  54.                 System.out.print(" "+ch);
  55.                 System.out.print(ch1+" ");
  56.  
  57.  
  58.             System.out.print (" 3. Search students by first name:      ");
  59.                 System.out.print(" "+ch);
  60.                 System.out.println(ch1+" ");
  61.  
  62.  
  63.                 for(int i=0;i<26;i++)
  64.                 System.out.print(" ");
  65.                 System.out.print(" "+ch);
  66.                 System.out.print(ch1+" ");
  67.  
  68.             System.out.print (" 4. Search students by last name:      ");
  69.                 System.out.print(" "+ch);
  70.                 System.out.println(ch1+" ");
  71.  
  72.  
  73.                 for(int i=0;i<26;i++)
  74.                 System.out.print(" ");
  75.                 System.out.print(" "+ch);
  76.                 System.out.print(ch1+" ");
  77.  
  78.  
  79.             System.out.print (" 5. Search searchstudents by GPA:");
  80.                 System.out.print(" "+ch);
  81.                 System.out.println(ch1+" ");
  82.  
  83.  
  84.                 for(int i=0;i<26;i++)
  85.                 System.out.print(" ");
  86.                 System.out.print(" "+ch);
  87.                 System.out.print(ch1+" ");
  88.  
  89.  
  90.                 System.out .print(" 6. Replace Student Record:             ");
  91.                 System.out.print(" "+ch);
  92.                 System.out.println(ch1+" ");
  93.  
  94.  
  95.                 for(int i=0;i<26;i++)
  96.                 System.out.print(" ");
  97.                 System.out.print(" "+ch);
  98.                 System.out.print(ch1+" ");
  99.  
  100.  
  101.             System.out .print(" 7. Delete Record:              ");
  102.                 System.out.print(" "+ch);
  103.                 System.out.println(ch1+" ");
  104.  
  105.  
  106.                 for(int i=0;i<26;i++)
  107.                 System.out.print(" ");
  108.                 System.out.print(" "+ch);
  109.                 System.out.print(ch1+" ");
  110.  
  111.  
  112.             System.out .print(" 8. Exit:                       ");
  113.                 System.out.print(" "+ch);
  114.                 System.out.println(ch1+" ");
  115.  
  116.  
  117.                 for(int j=0;j<27;j++)
  118.                 System.out.print(" ");
  119.                 System.out.print(ch);
  120.                 System.out.print(ch1);
  121.                 for(int i=0;i<34;i++)
  122.                 System.out.print(" ");
  123.                 System.out.print(ch);
  124.                 System.out.print(ch1);
  125.                 System.out.println("");
  126.                 for(int i=0;i<27;i++)
  127.                 System.out.print(" ");
  128.                 for(int i=0;i<38;i++)
  129.                 System.out.print(ch);
  130.                 System.out.println("");
  131.                 for(int i=0;i<27;i++)
  132.                 System.out.print(" ");
  133.                 for(int i=0;i<38;i++)
  134.                 System.out.print(ch);
  135.                 //Scanner input = new Scanner ( System.in);
  136.                  //int s;
  137.  
  138.                 int choice=0;
  139.                 String strChoice = JOptionPane.showInputDialog(null,"Pick your action");
  140.                 choice = Integer.parseInt(strChoice);
  141.                  //s=new input.nextInt();
  142.  
  143.                // SimpleComparator(int s) {
  144.                 switch (choice) {
  145.                         case 1:
  146.                         new_student();
  147.  
  148.                         break;
  149.                         case 2:
  150.                         display_allstudents();
  151.                                                                         dispay_gpa_average
  152.  
  153.                         break;
  154.                         case 3:
  155.                         search_by_first_name();
  156.  
  157.                         break;
  158.                         case 4:
  159.                         search_by_last_name();
  160.  
  161.                         break;
  162.                         case 5: 
  163.                        search_by_gpa();           
  164.                         break;
  165.                         case 6:
  166.                         replace_record();
  167.  
  168.                         break;
  169.                         case 7:
  170.                         delete_record();
  171.  
  172.                         break;
  173.                         case 8:
  174.  
  175.                         break;
  176.                          default:
  177.  
  178.                         break;
  179.                     //}
  180.                 //}
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.         }
  192.  
  193.            }
Feb 19 '08 #1
2 1166
Ganon11
3,652 Recognized Expert Specialist
This isn't a chat room, so you can't possibly expect an answer within 45 minutes. Also, we don't give out full solutions, we merely guide you to solving your own problems. We'd love to go through any specific issues you have if you can show us what you're attempted in order to solve them.

Additionally, please don't post two threads on one topic. It doesn't get you an answer any faster - if anything, it slows the response down, because people don't know what has been posted in the second topic, and they might repeat information. So basically keep it to one thread per topic.
Feb 19 '08 #2
nomad
664 Recognized Expert Contributor
I need to write a program that reads this from the text file
I don't think you're going to make it...
anyway read up on FileReader class.

nomad
Feb 19 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2158
by: Numberwhun | last post by:
Hello everyone! I am trying to learn java and have run into kind of a snag. Here is the code that I have so far: ------ <begin_code> ---------- import javax.swing.*; import javax.swing.JApplet; import javax.swing.JOptionPane; import java.awt.Graphics;
1
1986
by: HolaGoogle | last post by:
Hi all, Please help me with the following..it's realy urgent and i tried everything i could and i can't get it work properly!! Thanks in advance. Here's what i'm trying to accomplish: in my form i have a table with 3 rows (3 input text), in which user can enter values and then clik save. When he clicks the Save button, i'd like to be able to add the created items to the end of my table
0
1987
by: s_erez | last post by:
Hi, This is a realy tricky one. I have an ASP.NET application where some pages are reading data from a DB and presenting reports. In order for the user to wait while the page is reading data from the DB I am using a DIV with a please wait message which is removed once the page is loaded. In addition I am using a global error handling using the Application_Error void in the Global.asax file. when the application is loading a page which...
2
2363
by: rked | last post by:
I get nameSPAN1 is undefined when I place cursor in comments box.. <%@ LANGUAGE="VBScript" %> <% DIM ipAddress ipAddress=Request.Servervariables("REMOTE_HOST") %> <html> <head> <meta http-equiv="Content-Type" content="text/html;
7
3593
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title> </head> <style type="text/css">
4
3513
by: pshindle | last post by:
DB2 Team - I just downloaded and unzipped the new Fixpack 9 for DB2 ESE V8 for Windows (FP9_WR21350_ESE.exe). I then burned the unzipped Fixpack files to a CD. I proceded to install this Fixpack on a test machine running ESE but encountered a serious error during the install. It started 'copying new files' but then stopped cold and displayed a dialog box asking me to "Please insert disk 1". (It all fit on one CD!) I clicked OK...
23
3259
by: Jason | last post by:
Hi, I was wondering if any could point me to an example or give me ideas on how to dynamically create a form based on a database table? So, I would have a table designed to tell my application to create certain textboxes, labels, and combo boxes? Any ideas would be appreciated. Thanks
1
54492
PEB
by: PEB | last post by:
POSTING GUIDELINES Please follow these guidelines when posting questions Post your question in a relevant forum Do NOT PM questions to individual experts - This is not fair on them and we instruct our experts to ignore any such PMs completely Be sure to give the version of Access that you are working with and the Platform and OS if applicable.
4
2334
by: fatboySudsy | last post by:
Hi, I have constructed a client program that has given me some error codes that i just cannot see. I was wondering if a different set of eyes with much more experience than me could help me out. Here are the error codes and underneath i have listed the program. Thanks in advance for looking. client.c: In function `main': client.c:118: error: syntax error before '-' token client.c: At top level: client.c:132: error: conflicting types...
0
8179
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8685
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8348
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8493
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7176
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6112
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2613
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1493
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.