Read from a file called partyresponses

Assignment Help JAVA Programming
Reference no: EM131596797

Your program will read from a file called partyResponses.txt and count the number of people who have accepted and declined the Halloween party invitation. Hard code this file name into your program.

First, check that the file exists. If the file does not exist, tell the user nicely that the file doesn't exist, and quit the program.

If the file exists, your program is going to traverse the contents of the file. It will obtain a series of names and their yes or no response to whether they are going to go to the fun Halloween party. The format of input file is an unknown number of lines with each line containing two tokens: a first name and the word "yes" or "no".

For example:
Raven yes
Ichabod no

You won't know how many lines the input file contains but you can assume that every line will follow this format. You can program your read statements to input two tokens per line. You can also assume that "yes" and "no" will be all lowercase.

As your program traverses through the input file, it should keep track of all the yes answers and all the no answers. Before the program ends, it should print the number of people coming to the party and the number of people who have declined.

A sample input file can be found in Blackboard. This is not the file I will use to grade but it follows the same format.

A sample run: (your output doesn't have to be exactly the same as long as you indicate the number of people coming and the number of people not coming.)

Reference no: EM131596797

Questions Cloud

Create an accessor method and mutator method : Create an accessor method and mutator method for each of the data fields - Create a method called printBalance
Create a web site and integrate the mail- order business : SoftWear Silhouettes is a rapidly growing mail-order house specializing in all-cotton clothing. Management would like to expand sales to the Web.
Describe the approach you took in identifying your values : Describe the approach you took in identifying your three to five values. Which approach did you choose from the list above, and how did you use the approach.
Describe some of the company response strategies : 1. Identify multiple business pressures on Xerox. 2. Describe some of the company's response strategies.
Read from a file called partyresponses : Your program will read from a file called partyResponses.txt and count the number of people who have accepted and declined the Halloween party invitation
Quantitative and qualitative research : Discuss sources of bias for both quantitative and qualitative research. For quantitative research, be sure to address both random and systematic bias.
Provide a brief analysis of the ratios calculated : For each area, you should calculate the ratios from Appendix A and provide a brief analysis of the ratios calculated
Discuss the major types of security mechanisms : Visit the NetMotion Web site (www.netmotionwireless.com) and access and read other Mobility XE success stories. Discuss the patterns that can be observed.
A justification for your selections : A description of why each research study is categorized as quantitative or qualitative.A justification for your selections.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Java''s type int has limit onhow large aninteger it can store

Java's type int has a limit on how large an integer it can store. This limit can be circumvented by representing an integer as an array of digits. Write an interactive program that adds two integers of up to 50 digits each.

  Ood methodology

Your local police department wants to design new software to keep track of people, property, and criminal activity. List at least three classes you think should be in the design. For each class, identify some data members and methods.

  Implement a class icecreamcone

Implement a class IceCreamCone with methods getSurfaceArea() and getVolumn(). In the constructor, supply the height and radius of the cone. Be careful when looking up the formula for the surface area

  Add a draw() method to horse class.

Add a draw() method to your Horse class. You will also need to create a couple of Horses in your DrawPanel class, and call the draw() method for each Horse from the paintComponent() method. There is no need to modify the DrawPanelDriver class.

  Demonstrate the use of conditional and looping structures

The Java application should also meet these technical requirements: The application should have at least one class, in addition to the application's controlling class. The source code must demonstrate the use of conditional and looping structures

  Write a program called render.java

Optionally you may wish to add texture mapping to make your models look more realistic, and you may want to supply the user some controls that affect the colours and lighting.

  Display random numbers to simulate rolling a die

1. Display random numbers to simulate rolling a die2. Create a java program that simulate a casino game. (rollin a die)

  A method that takes a two-dimensional array

A method that takes a two-dimensional array of int's as a parameter and searches the array for the second parameter, returning true if the second parameter matches any of the integers in the array, and false otherwise.

  Develop a simplified version of a ftp program

CSCI 53700 - Fall 2016 - Develop a simplified version of a ftp program (similar to the one described in the end-to-end argument paper) using the stream sockets available in java.net package.

  Application that simulates a cash register

Implement a graphical application that simulates a cash register. Provide a text field for the item price and two buttons for adding the item to the sale, one for taxable items and one for nontaxable items. In a text area, display the register tap..

  One acre of land is equivalent to

One acre of land is equivalent to 43,560 square feet. Write a program that calculates the number of square feet in a tract of land with 3.5acres.

  Write a java program the displays the state bird and flower

Write a Java program the displays the State bird and flower. You should use your IDE for this exercise. You should also use Java classes

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd