Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A local charity is in need of a Java programmer to assist them with some of thei

ID: 3681586 • Letter: A

Question


A local charity is in need of a Java programmer to assist them with some of their needs. You have decided to show off your new Java skills, and have graciously volunteered to assist them. The charity needs to be able to track their donors, as well as the type of donations. For each Donor, the charity needs to know: Donor Id (integer identification number should be a unique value) Donor first name (String) Donor last name (String) Donor phone number (String) Donor email address (String) The charity has had issues with incorrect email addresses, so they are requesting a way to be able to determine if the email address is correct. At this time, the charity just wants to make sure there is a"@ in the email address. For each Donation, the charity wants to track Donation Id (integer identification number should be a unique value) Donor Id of the donor (integer identification number -should match a donor id in the donor list) Description of the donation (String up to length 25) Amount of the donation (double) Date of the donation (String) An indication if the donation is tax deductible (boolean) .A check number (integer) Currently the charity only accepts donations by check (no cash). But the charity would like to prevent fraud. So as a fraud detection measure, only check numbers greater than 100, but less than 5000 will be considered valid. Program Requirements The assignment this week is to create some of the classes for the problem scenario above. These classes will be used to implement data structures in later assignments First create a main class for this program, named as follows CS310Lastname For example, for this program: CS310Smith This is the class that will contain a main method. Then create two additional classes: Donor class a Donation class These classes will be used for creating and manipulating the Donor and Donation objects, and will not contain a main method.

Explanation / Answer

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
public class CS310lastname{

public class Donar
{
int donar_id;
String first_name;
String last_name;
int phone_no;
String email;
}
public class Donation
{
int donation_id;
String donation_desc;
double amount;
String date;
boolean tax_deduce;
int check;

}
public static void main(String []args){
BufferedReader br=null;
String Line;
try
{
br=new BufferedReader(new FileReader("c:\assn1input.txt"));
while ((Line = br.readLine()) != null) {
               System.out.println(Line);
           }

       } catch (IOException e) {
           e.printStackTrace();
       } finally {
           try {
               if (br != null)br.close();
           } catch (IOException ex)
           {
               ex.printStackTrace();
           }
}
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote