• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

help with assignment

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got an assignment due on Monday and I need some help to get at least some of it working so I can get some marks for it.

Scenario
A competition is being organised for the local country children, and prizes have been offered for winners of events. Prize winners in the competition are allowed to choose one prize from a selection of prizes. Several winners can choose the same prize, as there are more than one of each prize. Some prizes might not get chosen. Winners can change their choice, but can never have more than one prize. The prizes have a unique identifying number, a short description and a value. Winners have a unique id, allocated by the system, and starting at 2001, as well as personal details. Competition organisers need a program to help them store the details of prizes and winners. The program is to be menu based with winner and prize details to be stored in text files. Winner details are to be read from a file at the beginning of the program and stored in an array in memory. New winners are to be added to the array only. At the end of the program all winner records are to be written to disk, overwriting the old winner file. Prize details are to be read from a file at the beginning of the program and stored in an array in memory. The prize file will be appended to as and when new prizes are entered.

Program Specifications

When the program starts:
• Display the welcome message.
• Read the winner file (winners.txt) and store all records from the file into an array.
• Read the prizes.txt file and store all records from the file into an array.
• On the screen, display the total number of winner records read from the file.
• On the screen, display the total number of prize records read from the file.
• Display the main menu and wait for the user to enter an option



I was going ok but I am now stuck getting illegal start to expressions on the start of a lot of methods in my PrizeAllocationTUI file causing my program not to compile.




Compilation completed. The following files were not compiled:
2 errors found:
File: F:\learning\programming assignment\PrizeAllocationTUI.java [line: 182]
Error: F:\learning\programming assignment\PrizeAllocationTUI.java:182: illegal start of expression
File: F:\learning\programming assignment\PrizeAllocationTUI.java [line: 288]
Error: F:\learning\programming assignment\PrizeAllocationTUI.java:288: illegal start of expression



 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the ranch. Please UseCodeTags the next time you want to post code.

It seems that your showWinnerDetails method is not closed. Can you confirm this /
 
jose curle
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
that was indeed the problem thanks.
 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic