Java online training and java Download

Java Assignment Help Online

 

Hi Dear IT Students .  We have updated some Java Home work assignments solution for CSC516 and Others.

Interested People Can contact us : Get More then 95% Score in your Java Assignments.

To Get Solutions - Call us on Skype

Assignments --

Solution Available 

  1. (10 Points) Write a program SelectWinner.java to pick winners. You have 4 t-shirts and 2 ipads to give away and a pool of 16 students. The students are assigned numbers from 1 to 16. a. Randomly select 4 students to receive the t-shirts. (It is OK to select the same student more than one time) b. Randomly select 2 students to receive the iPads. Make sure to pick two different students. (Make use of loops in your program).

Sample output:

Winners for T-shirts are: Student number 7 9 12 9

Winners for i-Pads are: Student number 5 12

  1. (10 Points) A party planner is organizing a party. Write a program CostEstimate.java that performs the following, • Rental cost is $100. Food cost is as follows: For groups with 1-5 people, cost is $20 per person For groups with 6-10 people, cost is $18 per person For groups with 11-15 people cost is $16 per person For groups with more than 15 people, cost is $15 per person. • Define a method called cost which takes one parameters, the number of people in the party, calculates the per person price (food cost with rental cost), then returns the cost per person. • Call cost method in the program to produce a cost estimate table that shows the party size from 2, 4, up to 20 people.
  2. (10 Points) A person keeps a log of daily spending. Write a program SpendingReport.java that reports the statics of the spending for a week. • Ask user to enter daily spending within the week. (Day 1, Monday, through day 7, Sunday). Save the information in an array. • Calculate the total and the average spending for the week. • Count the total days where spending is higher than the average. • Print out average, total, number of days higher than the average and the day of the week with highest spending.

Sample output:

Enter spending day 1 ($): 25

Enter spending day 2 ($): 16.5

Enter spending day 3 ($): 23.5

Enter spending day 4 ($): 12

Enter spending day 5 ($): 0

Enter spending day 6 ($): 42

Enter spending day 7 ($): 31

Total spending: $ Average: $21.43/day

Number of days above average spending: 4

Highest spending day: Saturday

  1. (10 Points) Design a class called Student. This class is used to represent a student with student id, name and total number of units completed in college. Include standard methods (overloaded constructors, gets, sets, toString) and also include a method that determines the student’s class standing based on number of units completed, a student’s standing is a freshman if completed 30 units or under, a sophomore if completed 31 to 60 units, a junior if completed 61-90 units or a senior (90 units or above). Write out an UML diagram for the Student class. (See a sample in Fig 3.12 on Page 87). Then write Student.java to implement the class design. Write StudentTest.java to create a student object with id as 1234567, name as John Smith, number of units completed as 55.0. Print out the student information including the standing. Then ask user to enter the units completed in current semester, the print the updated information.

Sample output:

Student information : Student ID: 1234567

Student Name: John Smith

Total Number of Units Completed: 55.0

Class Standing: Sophomore

Enter Current Semester Units: 12.5

 

Updated Student information:

Student Name: John Smith

Total Number of Units Completed: 67.5

Class Standing: Junior

Spring CSC515 and CSC516 (or CSC355 and CSC455) Assignments and Solutions Available

Homework 1

Have a new class called CollegeStudent. A CollegeStudent is a kind of a student with a college name and a GPA. The CollegeStudent has collegeName and GPA properties, the appropriate constructors, and a toString() method that includes the collegeName and the GPA.

Modify ex9.java from the first set of notes to include college students initially and we can also add them. The new filename should be <lastname>1.java (for example, avitabile1.java).

When you finish, make a zip file that includes your application, project, and java files. It should contain everything, not just the java files. Also, tell me what version of JDeveloper you created it with. Do this for all homework assignments.

Solution Available 

Homework 2

Part 1:

Inside a project named <lastname>2a (for example, avitabile2a), do the following:

Create an abstract class called User. This class should have properties of username and password, a constructor that assigns values to username and password, a getUsername() method, a getPassword() method, and an abstract method named userInfo(). Create two classes named Reader  and Poet that contain constructors and also contain a userInfo() method. The userInfo() method should output the username, the password, and the kind of user.

Write a program named <lastname>2a.java (for example, avitabile2a.java) that creates a TreeSet; adds Readers and Poets to it, and outputs the values sorted by the usernames.

Make sure that your User class implements the Comparable interface and includes whatever methods you need to make that work..

Part 2:

Inside a project named <lastname>2b (for example, avitabile2b), do the following:

Create an interface called User. This interface should contain getUsername(), getPassword(), and driverInfo().

Create two classes named Poet and Reader that implement this interface.

Write a program  named <lastname>2b.java (for example, avitabile2b.java)that creates a TreeSet; adds Poets  to it, and outputs the values sorted by the usernames of the Poet.

Your User interface also contains the compareTo method.

Your Poet and Reader classes also implement the Comparable interface.

Solution Available 

Homework 3

All homework for this semester that use a database will  either use the file poetry.accdb or poetry.mdb. Both files are contained in a zip file named poetry.zip. Download it and unzip the files. Register one of them using ODBC.

The ER diagram for this database is:

Your project (named <lastname>3 - for example avitabile3) should include the following:

  1. A program named <lastname>3a.java that, using a Prepared Statement, executes the query of your choice from the database and outputs the results.
  1. A program named <lastname>3b.java that lets the user enter data to be inserted into the READERS table, thereby adding a new reader.

Make sure that your URL for the connection is: jdbc:odbc:poetry

Solution Available  

Homework 4

Create a project named <lastname>4.

In that project, create the following files:

An html file named <lastname4>.htm that contains a form and a number of form elements. Try using form elements other than text fields as well as using text fields. The submit for the form calls a servlet.  The servlet (named <lastname4>.java) does some sort of calculation and displays the result.

Solution Available 

Homework 5

 Create a project named <lastname>5. Put the following within it:

Write an html file named <lastname>5.htm that lets the user enter data to be inserted into the READERS table, and write a servlet named <lastname>5a.java that checks to see if there already is a reader with that READERID. If everything’s ok, do a forward to a second servlet named <lastname>5b.java that does the insert. If there’s a problem, do a forward to a third servlet named <lastname>5c.java that prints an error message.

Solution Available 

Homework 6

 Create a project named <lastname>6

  1. Write an JSP file named <lastname>6a.jsp that populates the options of a select with all CATEGORY values.The SQL statement to get this without duplicates isSELECT DISTINCT CATEGORY FROM POEMSThe action of the form that contains the select is to go to another JSP named <lastname>6b.jsp that will print (in a table) the POEMID, TITLE, DESCRIPTION, CATEGORY, and POETID for each poem of that category.

Solution Available 

Homework 7

 Create a project named <lastname>7.

Write an HTML file named <lastname>7.htm that contains form elements to let someone enter a person's name and the number of boxes of cookies that person has sold.. The action of the HTML file should go to a jsp file named <lastname>7.jsp.

 The jsp will calculate the gross and net income for that person.

 Gross income is calculated like this:

boxes_sold * 4

Net income is calculated like this:

boxes_sold * 2

 The jsp will output the name, boxes sold, gross income, and neet_income for that person.

 If any field of the input is empty, an appropriate error message should be printed.

Make sure you load all parameter values into a bean named <lastname>7.java. It will make it much easier to do homework 8 if you do this.

 You cannot use any java scriptlets in your jsp page. Use only JSTL tags.

Solution Available 

Homework 8

 Modify Homework 7 in the following way:

Have a second jsp named <lastname>8.jsp that will display in a table the data for all people entered in this session using the first jsp. You will want to have another Bean named <lastname>8.java that includes an ArrayList. This bean should include methods that let you add a <lastname>7 object to the ArrayList (setPerson) and return the ArrayList (getAll).

You cannot use any java scriptlets in your jsp page. Use only JSTL tags

Solution Available 

Homework 9

This is a repeat of homework 6. Just make sure that you use JSTL instead of Java scriptlets.

Create a project named <lastname>9

Write an JSP file named <lastname>9a.jsp that populates the options of a select with all CATEGORY values.

The SQL statement to get this without duplicates is

SELECT DISTINCT CATEGORY FROM POEMS

The action of the form that contains the select is to go to another JSP named <lastname>9b.jsp that will print (in a table) the POEMID, TITLE, DESCRIPTION, CATEGORY, and POETID for each poem of that category

Solution Available 

Homework 10

Use JSTL to do the following. Both problems will use the file hw10.xml

Create a project named <lastname>10

  1. Write a JSP file named <lastname>10a.jsp that will display, in a table, all information about customers.

  2. Write an HTML file named <lastname>10b.htm that will ask the user to enter the last name of a customer into a text field. The action of the form will be to go to a JSP file named <lastname>10b.jsp that will print, in a table, all information about customers with that last name.

Solution Available 

Homework 11(CSC516 only)

 Create a project named <lastname>11

Write an AJAX application using AJAX DWR that will display all information about a POEM when the user enters the POEM_ID into a text field.

 The html file should be named <lastname>11.htm; and the java filenames should also include your lastname.

Solution Available 

Homework 12(CSC516 only)

The video lectures for Struts 1, Struts 2, and Struts 3 contain enough information to do this assignment.

Create a struts application in a project named <lastname>12 that will have the following features:

  • an initial html file named <lastname>12.jsp that will allow a user to enter for a new READS record.
  • a jsp page named <lastname>success.jsp that will display a table of information about all READS records in the database (including the new one) - don't worry if the.new record doesn't show up immediately.
  • a series of jsp pages that will display the reason why the new READS record could not have been entered. These reasons should include that the RESPONSEID already exists, that the READERID does not exist in the READERS table, that the POEMID does not exist in the POEMS table, that one or more of the data fields are empty, or that the RANKING is not between 1 and 10.
  •  new subclass of Action named <lastname>12Action.java that will figure out what to do.
  • struts-config.xml

Solution Available 

Homework 13(CSC516 only)

The video lectures for Struts 4 and Struts5 contain enough information to do this assignment.

Modify homework 12. The changes are:

  • Your initial html file named <lastname>12.jsp now uses message resources property files to display all text.
  • Have an English message resources files and a Spanish message resources file. Use the Google translate site (http://translate.google.com/#) to translate from English to Spanish. The filenames should beMessageResources.properties and MessageResources_es.properties.
  • an ActionForm named <lastname>13ActionForm that will read the data from <lastname>12.jsp.
  • a subclass of Action named <lastname>13Action.java that will get the data from the <lastname>13ActionForm instance and see whether it is possible to insert the new reads record.
  • a jsp page named <lastname>success.jsp that will echo the information about the new reads record. The data should come from the <lastname>13ActionForm.

Solution Available 

 

Spring CSC455 / CSC516 PART - 2 (The College of Saint Rose Java Solutions)

 Note -  All these solutions are under JDeveloper IDE Tool . You can ask for other IDE if require

Homework 1

Have a new class called HighSchoolStudent. A HighSchoolStudent is a kind of a student with a high school and a grade. The HighSchoolStudent has highschool amd grade properties, the appropriate constructors, and a toString() method that includes the high school and grade.

Modify ex9.java from the first set of notes to include high school students initially and we can also add them.

When you finish, make a zip file that includes your application, project, and java files. It should contain everything, not just the java files. Also, tell me what version of JDeveloper you created it with. Do this for all homework assignments. 

Solution Available 

Homework 2

 Part 1:

Create an abstract class called Driver. This class should have properties of age and name, a constructor that assigns values to name and age, a getName() method, a getAge() method, and an abstract method named driverInfo(). Create two classes named TaxiDriver and RideShareDriver that contain constructors and also contain a driverInfo() method. The driverInfo() method should output the name, age, and the kind of driver.

 Write a program that creates a TreeSet; adds TaxiDrivers and RideShareDrivers to it, and outputs the values sorted by the names of the drivers.

 Make sure that your Driver class implements the Comparable interface and includes whatever methods you need to make that work..

 Part 2:

Create an interface called Driver. This interface should contain getAge(), getName(), and driverInfo().

Create two classes named TaxiDriver and RideShareDriver that implement this interface.

Write a program that creates a TreeSet; adds TaxiDrivers  to it, and outputs the values sorted by the names of the TaxiDriver.

Your Driver interface also contains the compareTo method.

Your TaxiDriver and RideShareDriver classes also implement the Comparable interface.

Solution Available 

Homework 3

 All homework for this semester that use a database will use the file rides.accdb The file is contained in a zip file. rides.zip. Download it and unzip the file.

The ER diagram for this database is:

Your project should include the following: 

  1. A program that, using a Prepared Statement, executes the query of your choice from the database and outputs the results.

  2. A program that lets the user enter data to be inserted into the CLIENT table, thereby adding a new client.

Make sure that your URL for the connection is: jdbc:odbc:rides 

Solution Available 

Homework 4

1. Create an html file with a form and a number of form elements. Try using form elements other than text fields as well as using text fields. The submit for the form calls a servlet.  The servlet does some sort of calculation and displays the result.

2. Write a html file that lets the user enter data for a new client, and a servlet that adds that new client into the CLIENT table.

Solution Available 

Homework 5

1. Write an html file that lets the user enter data to be inserted into the CLIENT table, and write a servlet that checks to see if there already is a course with that CLIENT_ID. If everything’s ok, do a forward to a second servlet that does the insert. If there’s a problem, do a forward to a third servlet that prints an error message. 

Both the second and the third servlet should print the number of successful and unsuccessful inserts that have been done so far in this session.

Solution Available 

Homework 6

  • Write an html file that lets the user enter data to be inserted into the CLIENT table, and write a JSP that checks to see if there already is a client with that CLIENT_ID. If everything’s ok, do a forward to a second JSP that does the insert. If there’s a problem, do a forward to a third JSP that prints an error message. 

    Both the second and the third JSP should print the number of successful and unsuccessful inserts that have been done so far in this session.

     

  • Write an JSP file that populates the options of a select with all DRIVER_CITY values.

    The SQL statement to get this without duplicates is

    SELECT DISTINCT DRIVER_CITY FROM DRIVER

  • The action of the form that contains the select is to go to another JSP that will print (in a table) the DRIVER_ID, DRIVER_NAME, DRIVER_NAME, and DRIVER_EMAIL for all drivers from that city.

Solution Available 

Homework 7

Write an HTML file that contains form elements to let someone enter a person's name, the number of hours a person has worked, and the hourly wage for a person. The action of the HTML file should go to a jsp file.

The jsp will calculate the salary and tax for that person.

Salary is calculated like this:

hours_worked * hourly_wage

Tax is calculated like this:

salary * .07 

The jsp will output the name, hours worked, hourly wage, salary, and tax for that person.

If any field of the input is empty, an appropriate error message should be printed.

Make sure you load all parameter values into a bean. It will make it much easier to do hw8 if you do this.

You cannot use any java scriptlets in your jsp page. Use only JSTL tags.

Solution Available 

Homework 8

Modify Homework 8 in the following ways:

Make sure that the salary and tax are displayed using exactly 2 digits to the right of the decimal place.

Have a second jsp that will display in a table the data for all people entered in this session using the first jsp. You will want to have another Bean that includes an ArrayList of Persons. This bean should include methods that let you add a Person to the ArrayList (setPerson) and return the ArrayList (getAll).

You cannot use any java scriptlets in your jsp page. Use only JSTL tags.

Solution Available  

Homework 9

This is a repeat of homework 6. Just make sure that you use JSTL instead of Java scriptlets. 

  1. Write an html file that lets the user enter data to be inserted into the CLIENT table, and write a JSP that checks to see if there already is a client with that CLIENT_ID. If everything’s ok, do a forward to a second JSP that does the insert. If there’s a problem, do a forward to a third JSP that prints an error message. 

    Both the second and the third JSP should print the number of successful and unsuccessful inserts that have been done so far in this session.

  2. Write an JSP file that populates the options of a select with all DRIVER_CITY values.

    The SQL statement to get this without duplicates is

    SELECT DISTINCT DRIVER_CITY FROM DRIVER

    The action of the form that contains the select is to go to another JSP that will print (in a table) the DRIVER_ID, DRIVER_NAME, DRIVER_NAME, and DRIVER_EMAIL for all drivers from that city.

 Solution Available 

Homework 10

Use JSTL to do the following. Both problems will use the file hw10.xml

  1. Write a JSP file that will display, in a table, all information about employees.

  2. Write an HTML file that will ask the user to enter the first name of an employee into a text field. The action of the form will be to go to a JSP file that will print, in a table, all information about employees with that first name.

Solution Available 

Homework 11

Write an AJAX application using AJAX DWR that will display all information about a RIDE when the user enters the RIDE_ID into a text field.

Solution Available 

Homework 12 

The video lectures for Struts 1, Struts 2, and Struts 3 contain enough information to do this assignment.

Create a struts application that will have the following features:

  • an initial html file named hw12.jsp that will allow a user to enter information about a new ride.

  • a jsp page named success.jsp that will display a table of information about all rides in the database (including the new one).

  • a series of jsp pages that will display the reason why the new ride could not have been entered. These reasons should include that the RIDE_ID already exists, that the DRIVER_ID does not exist in the DRIVER table, that the CLIENT_ID does not exist in the CLIENT table, that one or more of the data fields are empty, or that the fee is not between 0 and 100.

  •  new subclass of Action named hw12Action.java that will figure out what to do.

  • struts-config.xml

 Solution Available 

 Homework 13

Create a struts application that will have the following features:

  • struts-config.xml

  • an initial html file named hw13.jsp that will allow a user to enter information about a new ride. This file will use message resources property files to display all text.

  • Have an English message resources files and an Italian message resources file. Use the Google translate site (http://translate.google.com/#) to translate from English to Italian. The filenames should beMessageResources.properties and MessageResources_it.properties.

  • an ActionForm named HW13ActionForm that will read the data from hw13.jsp.

  • a subclass of Action named HW13Action.java that will get the data from the HW13ActionForm instance and see whether it is possible to insert the ride.

  • a jsp page named success.jsp that will echo the information about the new ride. The data should come from the HW13ActionForm.

  • a series of jsp pages that will display the reason why the new ride could not have been entered. These reasons should include that the RIDE_ID already exists, that the DRIVER_ID does not exist in the DRIVER table, that the CLIENT_ID does not exist in the CLIENT table, that one or more of the data fields are empty, or that the fee is not between 0 and 100.

 Solution Available 

Spring CSC455 / CSC516 PART - 3 (The College of Saint Rose Java Solutions)

Note -  All these solutions are under JDeveloper IDE Tool . You can ask for other IDE if require

Homework 1

Have a new class called PartTimeStudent. A PartTimeStudent is a kind of a student with a job. The PartTimeStudent has an employer property, and the appropriate constructors, and a toString() method that includes the employer.

Modify ex9.java from the first set of notes to include part time students initially and we can also add them.

When you finish, make a zip file that includes your application, project, and java files. It should contain everything, not just the java files. Also, tell me what version of JDeveloper you created it with. Do this for all homework assignments.

 Email this zip file as an attachment to This email address is being protected from spambots. You need JavaScript enabled to view it." data-type="mail">'+addy_text59257+'<\/a>'; //-->\n

 Solution Available 

Homework 2

Create a zip file that contains your entire project and email it to This email address is being protected from spambots. You need JavaScript enabled to view it." data-type="mail">'+addy_text37408+'<\/a>'; //-->\n

Part 1:

Create an abstract class called Pet. This class should have at least two abstract methods in it. Create two classes named Cat and Dog that implement these abstract methods. Write a program that creates a TreeSet; adds Cats and Dogs to it, and outputs the values sorted by the names of the pets. Make sure that your Pet class implements the Comparable interface.

Part 2:

Create an interface called Pet. This class should have at least two methods in it. Create two classes named Cat and Dog that implement this interface. Write a program that creates a TreeSet; adds Cats  to it, and outputs the values sorted by the names of the pets. Make sure that your Pet interface contains the compareTo method and your Cat and Dog classes implement the Comparable interface also.

Solution Available 

Homework 3

Create a zip file that contains your entire project and email it to This email address is being protected from spambots. You need JavaScript enabled to view it." data-type="mail">'+addy_text10999+'<\/a>'; //-->\n .

Your project should include the following: 

  1. A program that, using a Prepared Statement, executes the query of your choice from the database and outputs the results.

  2. A program that lets the user enter data to be inserted into the COURSES table, thereby adding a new course.

Make sure that your URL for the connection is: jdbc:odbc:registrar

Solution Available 

Homework 4

1. Create an html file with a form and a number of form elements. Try using form elements other than text fields as well as using text fields. The submit for the form calls a servlet.  The servlet does some sort of calculation and displays the result.

2. Write a html file that lets the user enter data to be inserted into the COURSES table, and have a servlet that will do the insert.

Zip all your work together. Email it to me (This email address is being protected from spambots. You need JavaScript enabled to view it.) in an attachment, as usual.

Solution Available 

Homework 5 

  1. Write an html file that lets the user enter data to be inserted into the COURSES table, and write a servlet that checks to see if there already is a course with that course number. If everything’s ok, do a forward to a second servlet that does the insert. If there’s a problem, do a forward to a third servlet that prints an error message.

Both the second and the third servlet should print the number of successful and unsuccessful inserts that have been done so far in this session.

Solution Available 

Homework 6 

  • Write an html file that lets the user enter data to be inserted into the COURSES table, and write a JSP that checks to see if there already is a course with that course number. If everything’s ok, do a forward to a second JSP that does the insert. If there’s a problem, do a forward to a third JSP that prints an error message. 

    Both the second and the third JSP should print the number of successful and unsuccessful inserts that have been done so far in this session.

  • Write an JSP file that populates the options of a select with all rooms that have a class offered in them. The action of the form that contains the select is to go to another JSP that will print (in a table) the course, section, dates, times, and instructor for all offerings that are held in that room.

Solution Available 

Homework 7

Write an HTML file that contains form elements to let someone enter the name of a company, a number of shares a person bought, the purchase price, and the sale price. The action of the HTML file should go to a jsp file. 

The jsp will calculate the profit and tax for that stock. 

A profit is calculated like this:

(sale_price - purchase_price) * shares

Tax is calculated like this if profit is at least 0:

profit * .15

If profit is negative, tax is 0.

The jsp will output the company name, shares, profit, and tax for that stock.

And if any field of the input is empty, an appropriate error message should be printed.

Make sure you load all parameter values into a bean. It will make it much easier to do hw8 if you do this.

You cannot use any java scriptlets in your jsp page. Use only JSTL tags.

Solution Available 

Homework 8

Modify Homework 7 in the following ways:

Make sure that the profit and tax are displayed using exactly 2 digits to the right of the decimal place.

Have a second jsp that will display in a table the data for all stocks entered in this session using the first jsp. You will want to have another Bean that includes an ArrayList of Stocks. This bean should include methods that let you add a Stock to the ArrayList (setStock) and return the ArrayList (getAll).

You cannot use any java scriptlets in your jsp page. Use only JSTL tags.

Solution Available 

Homework 9

 This is a repeat of homework 6. Just make sure that you use JSTL instead of Java scriptlets.

  1. Write an html file that lets the user enter data to be inserted into the COURSES table, and write a JSP that checks to see if there already is a course with that course number. If everything’s ok, do a forward to a second JSP that does the insert. If there’s a problem, do a forward to a third JSP that prints an error message. 

    Both the second and the third JSP should print the number of successful and unsuccessful inserts that have been done so far in this session.

     

  2. Write an JSP file that populates the options of a select with all rooms that have a class offered in them. The action of the form that contains the select is to go to another JSP that will print (in a table) the course, section, dates, times, and instructor for all offerings that are held in that room.

Solution Available 

Homework 10

Use JSTL to do the following. Both problems will use the file hw10.xml

  1. Write a JSP file that will display, in a table, all information about customers. 

  2. Write an HTML file that will ask the user to enter the name of a city into a text field. The action of the form will be to go to a JSP file that will print, in a table, all information about customers who live in that city.

    Solution Available 

Homework 11

Write an AJAX application using AJAX DWR that will display all information about an offering when the user enters a CRN in a text field.

Solution Available 

Homework 12

Create a struts application that will have the following features:

  • an initial html file named hw12.jsp that will allow a user to enter information about a new course.

  • a jsp page named success.jsp that will display a table of information about all courses in the database (including the new one).

  • a series of jsp pages that will display the reason why the new class could not have been entered. These reasons should include that the course already exists, that one or more of the data fields were empty, or the number of credits was not between 0 and 6 (inclusive).

  •  new subclass of Action named hw12Action.java that will figure out what to do.

  • struts-config.xml

 Solution Available 

Homework 13

Create a struts application that will have the following features:

  • struts-config.xml

  • an initial html file named hw13.jsp that will allow a user to enter information about a new course. This file will use message resources property files to display all text.

  • Have an English message resources files and an Italian message resources file. Use the Google translate site (http://translate.google.com/#) to translate from English to Italian. The filenames should beMessageResources.properties and MessageResources_it.properties.

  • an ActionForm named HW13ActionForm that will read the data from hw13.jsp.

  • a bean named HW13Results.java that has success and failure properties; with the appropriate get and set methods. The default values of the properties should be 0.

  • a subclass of Action named HW13Action.java that will use or create a session-scoped Results bean. hw13Action should get the data from the HW13ActionForm instance and see whether it is possible to insert the course. If it can do the insert, it should do the insert and increment success. If it can't do the insert, it should do increment failure.

  • a jsp page named success.jsp that will display the number of successes, failures, and echo the information about the new course. The data should come from the HW13ActionForm and HW13Results beans.

  • a series of jsp pages that will display the reason why the new class could not have been entered. These reasons should include that the course already exists, that one or more of the data fields were empty, or the number of credits was not between 0 and 6 (inclusive). Also include the values from the HW13Results bean.

Solution Available  

Spring CSC455 / CSC516 PART - 4 (The College of Saint Rose Java Solutions)

 Note -  All these solutions are under JDeveloper IDE Tool . You can ask for other IDE if require

Homework 1

Have a new class called Alumni. An Alumni is a kind of a Student with a degree and a graduation_year. For this class, include the appropriate properties, get methods, constructors, and a toString() method that includes the degree and graduation year.

Modify ex9.java from the first set of notes to include alumni initially and we can also add them.

When you finish, make a zip file that includes your application, project, and java files.

Email this zip file as an attachment to This email address is being protected from spambots. You need JavaScript enabled to view it." data-type="mail">'+addy_text63731+'<\/a>'; //-->\n

Solution Available 

Homework 2

Create a zip file that contains your entire project and email it to This email address is being protected from spambots. You need JavaScript enabled to view it." data-type="mail">'+addy_text41153+'<\/a>'; //-->\n .

Part 1:

Create an abstract class called School. This class should have two abstract methods in it - getInformation() and getMinimumAge(). It should also have a name property, a getName() method, and a constructor that takes the name of the School as an argument. Make sure that your School class implements the Comparable interface.

Create two classes named College and HighSchool that implement these abstract methods - the output of the methods will be different, of course. The classes should have a constructor that takes the name of the School as an argument.

Write a program that creates a TreeSet; adds Colleges and HighSchools to it, and outputs the name, information, and minimum age, sorted by the name of the School.

 Part 2:

Create an interface called School. This interface should include the getInformation and getMinimumAge methods. Create two classes named College and HighSchool that implement this interface. Write a program that creates a TreeSet; adds Colleges  to it, and outputs the name, information, and minimum age, sorted by the name of the School, Make sure that your School interface contains the compareTo method and your College and HighSchool classes implement the Comparable interface as well as the School interface.

 Solution Available 

Homework 3

 Create a zip file that contains your entire project and email it to This email address is being protected from spambots. You need JavaScript enabled to view it." data-type="mail">'+addy_text4797+'<\/a>'; //-->\n .

Your project should include the following:

  1. A program that, using a Prepared Statement, executes the query of your choice from the database and outputs the results.

  2. A program that lets the user enter a new record to be inserted into the STUDENTS and USERS table, thereby adding a new student. Make sure you do the insert for the USER first. Note that some information about a student (first and last name, etc.) goes into the USERS table and some information (major, address, and so on) goes into the STUDENTS table. This will be the case for many subsequent assignments.

Make sure that your URL for the connection is: jdbc:odbc:registrar 

Solution Available 

Homework 4

1. Create an html file with a form and a number of form elements. Try using form elements other than text fields as well as using text fields. The submit for the form calls a servlet.  The servlet does some sort of calculation and displays the result.

2. Write a html file that lets the user enter data that will be entered into the STUDENTS and USERS table, thereby adding a new student. Then have a servlet that will dinsert (make sure you insert the USER record before you insert the STUDENT record).

Zip all your work together. Email it to me (This email address is being protected from spambots. You need JavaScript enabled to view it.) in an attachment, as usual.

Solution Available 

Homework 5

  1. Write an html file that lets the user enter a new student to be inserted into the STUDENTS and USERS tables, and write a servlet that checks to see if there already is a Student with that UserID. If everything’s ok, do a forward to a second servlet that does the inserts. If there’s a problem, do a forward to a third servlet that prints an error message.

Both the second and the third servlet should print the number of successful and unsuccessful inserts that have been done so far in this session. Use session variables to keep track of this.

Solution Available 

Homework 6

  1. Write an html file that lets the user enter data on a new student to be inserted into the STUDENTS and USERS table, and write a JSP that checks to see if there already is a Student with that UserID. If everything’s ok, do a forward to a second JSP that does the inserts. If there’s a problem, do a forward to a third JSP that prints an error message. 

    Both the second and the third JSP should print the number of successful and unsuccessful inserts that have been done so far in this session.

     

  2. Write an JSP file that populates the options of a select element that shows all the majors that students have (determined at runtime; not hard-coded). The action of the form that contains the select element is to go to another JSP that will print (in a table) information about the students who have that major.

 Solution Available 

Homework 7

Write an HTML file that contains form elements to let someone enter the name of a company, a number of shares a person bought, the purchase price, and the sale price. The action of the HTML file should go to a jsp file.

The jsp will calculate the profit and tax for that stock.

A profit is calculated like this:

(sale_price - purchase_price) * shares

Tax is calculated like this if profit is at least 0:

profit * .15

If profit is negative, tax is 0.

The jsp will output the company name, shares, profit, and tax for that stock.

And if any field of the input is empty, an appropriate error message should be printed.

Make sure you load all parameter values into a bean. It will make it much easier to do hw8 if you do this.

You cannot use any java scriptlets in your jsp page. Use only JSTL tags.

Solution Available 

Homework 8

Modify Homework 7 in the following ways:

Make sure that the profit and tax are displayed using exactly 2 digits to the right of the decimal place.

Have a second jsp that will display in a table the data for all stocks entered in this session using the first jsp. You will want to have another Bean that includes an ArrayList of Stocks. This bean should include methods that let you add a Stock to the ArrayList (setStock) and return the ArrayList (getAll).

You cannot use any java scriptlets in your jsp page. Use only JSTL tags.

Solution Available 

Homework 9

This is a repeat of homework 6. Just make sure that you use JSTL instead of Java scriptlets.

  1. Write an html file that lets the user enter data on a student that will be inserted into the STUDENTS and USERS table, and write a JSP that checks to see if there already is a student with that userID. If everything’s ok, do a forward to a second JSP that does the inserts. If there’s a problem, do a forward to a third JSP that prints an error message. 

    Both the second and the third JSP should print the number of successful and unsuccessful inserts that have been done so far in this session.
     

  2. Write an JSP file that populates the options of a select element with all majors that students have. The action of the form that contains the select is to go to another JSP that will print (in a table) the information about all students with that major.

Solution Available  

Homework 10

Use JSTL to do the following. Both problems will use the file hw10.xml

  1. Write a JSP file that will display, in a table, all information about employees.
     

  2. Write an HTML file that will ask the user to enter the first name of an employee into a text field. The action of the form will be to go to a JSP file that will print, in a table, all information about employees with that name.

Solution Available 

Homework 11

 Write an AJAX application using AJAX DWR that will display all information about a student when the user enters a userID in a text field.

Solution Available 

Homework 12

The video lectures for Struts 1, Struts 2, and Struts 3 contain enough information to do this assignment.

Create a struts application that will have the following features:

  • an initial html file named hw12.jsp that will allow a user to enter information about a new student.

  • a jsp page named success.jsp that will display a table of information about all students in the database (including the new one).

  • a series of jsp pages that will display the reason why the new student could not have been entered. These reasons should include that the userID already exists, that one or more of the data fields were empty, or the password contained fewer than 6 characters.

  •  new subclass of Action named hw12Action.java that will figure out what to do.

  • struts-config.xml

Solution Available 

Homework 13

Create a struts application that will have the following features:

  • struts-config.xml

  • an initial html file named hw13.jsp that will allow a user to enter information about a new student. This file will use message resources property files to display all text.

  • Have an English message resources files and a Danish message resources file. Use the Google translate site (http://translate.google.com/#) to translate from English to Danish. The filenames should beMessageResources.properties and MessageResources_da.properties.

  • an ActionForm named HW13ActionForm that will read the data from hw13.jsp.

  • a bean named HW13Results.java that has success and failure properties; with the appropriate get and set methods. The default values of the properties should be 0.

  • a subclass of Action named HW13Action.java that will use or create a session-scoped Results bean. hw13Action should get the data from the HW13ActionForm instance and see whether it is possible to insert the user and student. If it can do the inserts, it should do the inserts and increment success. If it can't do the insert, it should do increment failure.

  • a jsp page named success.jsp that will display the number of successes, failures, and echo the information about the new student. The data should come from the HW13ActionForm and HW13Results beans.

  • a series of jsp pages that will display the reason why the new class could not have been entered. These reasons should include that the student already exists, that one or more of the data fields were empty, or the password was less than six characters. Also include the values from the HW13Results bean.

Solution Available 

Get Customized Solutions also as per your requirements

Assignment 1 :-

Question: Drivers are concerned with the mileage their automobiles get. One driver has kept track of several trips by recording the miles driven and gallons used for each tankful. Develop a Java application that will input the miles driven and gallons used (both as integers) for each trip. The program should calculate and display the miles per gallon obtained for each trip and print the combined miles per gallon obtained for all trips up to this point. All averaging calculations should produce floating-point results. Use class Scanner and sentinel-controlled repetition to obtain the data from the user.

 Solution Available 

Other Assignments : - 

Homework 11 COSC_236

--> Download Solution Homework 11 COSC_236

Write a Java documented program to perform the role of a quiz maker. The program should work as follows:

  1. Prompt the student to enter their user name and password. Read a file that contains a list of all students’ information to validate the login credentials.Start the quiz only when the credentials are correct. After 3 failed attempts, exit the program.

  2. Randomly pick ten questions from the TestBank.txtfile.

  3. Display one question at a time. Get the answer then move to the next question.

  4. Do not accept answers other than true or false (T or F should be fine too). The answers should not be case sensitive.

  5. When the user is done with the quiz, print out a report (On screen and on a file) with the below information in it:

    • First name

    • Last name

    • Score

    • Elapsed time

    • User’s answers and the correct answer.

  6. Name the file from step 5 as follows: (userName_COSC_236_Quiz_Date_Time), where:

    • userName is the actual user name of the student who took the quiz.

    • Date_Time is the date and time of the start of the test.

  7. Prompt for another user name and password or done as a user name to exit.

Solution Available 

Homework 12

Week 12 Lab Assignment Using Greenfoot
Please use the starter file from Week 11.

Remember to use modules, proper formatting, comments etc. Be sure to label each output and leave a blank line between each output. Upload you solution as: Week12_Assignment_<LastName>_<Version>.zip (1pt)
1. (3 pts) Write a method using while loop that prints all of the even numbers starting from the value that is provided, down to (but not including) 0. Test your method by using the value 10, such that the output is:
10 8 6 4 2
2. (2 pts) Use a while loop to print this multiplication table:
1 times 10 = 10
2 times 10 = 20
3 times 10 = 30
4 times 10 = 40
5 times 10 = 50
6 times 10 = 60
7 times 10 = 70
8 times 10 = 80
9 times 10 = 90
10 times 10 = 100
3. (3 pts) Use a do while loop to continuously generate a random number from 0 to 99, Stopping once the number 0 is found. When that occurs output the following:
Problem 3 generated <number> random numbers from 0 to 99 before hitting 0. The highest number generated was <number> and the average value was <number>.
4. (3 pts) Set the screen size of 800 and 600 and:
a. Use a for loop to populate 2 arrays for x and y positions such that the array is evenly spaced across the dimension (x or y) 10 times.
b. Use the array length as part of a while loop to populate 100 objects (of your choice) in the world using the co-ordinates generated in 4a

Solution Available 

Homework 13

--> Homework 13 - AsciiArt-CSE 142, Autumn 

Part A: ASCII Art (4 points): The first part of your assignment is to write a program that produces any text art (sometimes called "ASCII art") picture you like.

Write a Java class named AsciiArt in a file named AsciiArt.java. We will share everyone’s art on the class website. Your program can produce any text picture you like, with the following restrictions and details:

The picture should be your own creation, not an ASCII image you found on the Internet or elsewhere.•

The number of lines drawn should be at least 3 but no more than 200, and no more than 100 characters / line.• The picture should not include hateful, offensive, or otherwise inappropriate images.•

The code should use at least one for loop or static method, but should not contain infinite loops.•

The picture must not be identical to your solution for Part B or consist entirely of reused Part B code.•

Your code should not use material beyond Ch. 3 of the book.•

If your Part A program compiles and runs successfully and meets the above constraints, it will receive the full 4 points. Part A will not be graded on style ("internal correctness")

 

CIS 043 Midterm Exam I - Programming Problems: (40 points)

Download All CIS 043 Solutions

Q 1 . (10 Points) Write a program SelectWinner.java to pick winners. You have 4 t-shirts and 2 ipads

to give away and a pool of 16 students. The students are assigned numbers from 1 to 16.

a. Randomly select 4 students to receive the t-shirts. (It is OK to select the same student

more than one time)

b. Randomly select 2 students to receive the iPads. Make sure to pick two different

students. (Make use of loops in your program).

Sample output:

Winners for T-shirts are: Student number 7 9 12 9

Winners for i-Pads are: Student number 5 12

Q 2 .(10 Points) A party planner is organizing a party. Write a program CostEstimate.java that
performs the following,
• Rental cost is $100. Food cost is as follows:
For groups with 1-5 people, cost is $20 per person
For groups with 6-10 people, cost is $18 per person
For groups with 11-15 people cost is $16 per person
For groups with more than 15 people, cost is $15 per person.
• Define a method called cost which takes one parameters, the number of people in the
party, calculates the per person price (food cost with rental cost), then returns the cost
per person.
• Call cost method in the program to produce a cost estimate table that shows the party
size from 2, 4, up to 20 people. Sample output:
Party Size (#people) Cost Estimate Per Person
2 $70.00
4 $45.00
6 $34.67
8 $30.50
10 $28.00
12 $24.33
….
20 $20.00

Q 3 .(10 Points) A person keeps a log of daily spending. Write a program SpendingReport.java that
reports the statics of the spending for a week.
• Ask user to enter daily spending within the week. (Day 1, Monday, through day 7,
Sunday). Save the information in an array.
• Calculate the total and the average spending for the week.
• Count the total days where spending is higher than the average.
• Print out average, total, number of days higher than the average and the day of the
week with highest spending.
Sample output:
Enter spending day 1 ($): 25
Enter spending day 2 ($): 16.5
Enter spending day 3 ($): 23.5
Enter spending day 4 ($): 12
Enter spending day 5 ($): 0
Enter spending day 6 ($): 42
Enter spending day 7 ($): 31
Total spending: $ Average: $21.43/day
Number of days above average spending: 4
Highest spending day: Saturday
 

Q 4. (10 Points) Design a class called Student. This class is used to represent a student with student
id, name and total number of units completed in college. Include standard methods
(overloaded constructors, gets, sets, toString) and also include a method that determines the
student’s class standing based on number of units completed, a student’s standing is a freshman
if completed 30 units or under, a sophomore if completed 31 to 60 units, a junior if completed
61-90 units or a senior (90 units or above). Write out an UML diagram for the Student class.
(See a sample in Fig 3.12 on Page 87). Then write Student.java to implement the class design.
Write StudentTest.java to create a student object with id as 1234567, name as John Smith,
number of units completed as 55.0. Print out the student information including the standing.
Then ask user to enter the units completed in current semester, the print the updated
information.
Sample output:
Student information :
Student ID: 1234567
Student Name: John Smith
Total Number of Units Completed: 55.0
Class Standing: Sophomore
Enter Current Semester Units: 12.5
Updated Student information:
Student Name: John Smith
Total Number of Units Completed: 67.5
Class Standing: Junior

Assignment COSC 236 Solution - 

Download COSC 236 Solution here

Part 2

Modify your code from part 1 so that instructors can also use your program. Change your login method to recognize if the username/password entered belong to a student or instructor (based on the last column in the UsersInfo.txt file). If the user is a student, you will need to go with the regular path (start the quiz). If the user is an instructor, display the following options as a menu:

1 )Register a new student.

  • Ask the instructor to entera student’s information: first name, last name, username, email.The password needs to be generated automatically. All the information will then be added to the Users_Info.txt file.

2) Displaystats

  • Display on screen the following stats: the studentwith the shortest duration, highest grade, the lowest grade and average grade of the class. (Hint: upon a successful completion of each quiz, write the student’s name, elapsed time and score to a file, use this to extract the stats listed above).

3) Add new questions

  • Allow the instructor to addnew questions to the test bank. The questions can be added in two ways: 1) manually by typing the question and the answer. 2) by providing a file name to be read and appended to the original test bank.

 

 

Filter Streams - Java Network Programming Assignment and get Unique Solution

Lab2: Digest Streams and Running Threads

The java.security package contains two filter streams that can calculate a message digest for a stream. They are DigestInputStream and DigestOutputStream. A message digest, represented in Java by the java.security.MessageDigest class, is a strong hash code for the stream; that is, it is a large integer (typically 20 bytes long in binary format) that can easily be calculated from a stream of any length in such a fashion that no information about the stream is available from the message digest. Message digests can be used for digital signatures and for detecting data that has been corrupted in transit across the network. In practice, the use of message digests in digital signatures is more important.

To calculate a digest for an output stream, you first construct a MessageDigest object that uses a particular algorithm, such as the Secure Hash Algorithm (SHA). You pass both the MessageDigest object and the stream you want to digest to the DigestOutputStream constructor. This chains the digest stream to the underlying output stream. Then you write data onto the stream as normal, flush it, close it, and invoke the getMessageDigest() method to retrieve the MessageDigest object. Finally you invoke the digest() method on the MessageDigest object to finish calculating the actual digest. For example:

MessageDigest sha = MessageDigest.getInstance(“SHA”);

DigestOutputStream dout = new DigestOutputStream(out, sha);

byte[] buffer = new byte[128];

while (true) {

    int byteRead = in.read(buffer);

    if (bytesRead < 0) break;

    dout.write(buffer, 0, bytesRead);

}

dout.flush();

dout.close();

byte[] result = dout.getMessageDigest().digest();

Calculating the digest of an input stream you read is equally simple. It still isn’t quite as transparent as some of the other filter streams because you do need to be at least marginally conversant with the methods of the MessageDigest class.

Your lab assignment is to write a program that calculates the Secure Hash Algorithm (SHA) digest for many files. This is mostly an I/O bound program that is, it spends a lot of time to read in data from hard drive or actually wait for that data since hard drive is slow compared to cpu. This is characteristic of a lot of network programs; they tend to execute faster than the network can supply input. Consequently, they spend a lot of time blocked. This is time that other threads can use, either to process other input sources or to do something that doesn’t rely on slow input. Your assignment can be broken in two phases:

  1. You write a simple program with a single class that reads at least two file (more than one file) and calculates the SHA digest for each file. Then, it prints out the result (digest for each file) on the screen as the following:

annaresume.doc: -16 -110 38 30 -30 -128 -24 68 -101 -97 -113 -109 -27 0 76 -7 126 46 -92 16 sc190.doc: -40 52 65 77 78 116 -54 109 60 -127 -62 67 58 80 -83 5 -35 -1 -78 -40

  1. You modify the program such that it uses threads. The idea is to assign a separate thread to process each individual input file.

An example code segment for using a DigestInputStream is shown below (it assumes that an in input file stream (FileInputStream) is already created):

 

MessageDigest sha = MessageDigest.getInstance("SHA");

      DigestInputStream din = new DigestInputStream(in, sha);

        int b;

      while ((b = din.read()) != -1) ;

      din.close();

      byte[] digest = sha.digest(); 

An example for Threads: a thread with a little t is a separate independent path of execution in the virtual machine. A Thread with a capital T is an instance of the java.lang.Thread class. There is a one-to-one relationship between threads executing in the virtual machine and Thread objects constructed by the virtual machine. Most of the time, it’s obvious from the context which is meant if the difference is really important. To start a new thread running in the virtual machine, you construct an instance of the Thread class and invoke its start() method, like this:

       Thread t = new Thread();

       t.start();

Of course, this thread isn’t very interesting because it doesn’t have anything to do. To give a thread something to do, you either subclass the Thread class and override its run() method, or implement the Runnable interface and pass the Runnable object to the Thread constructor. In both cases, the key is the run() method, which has this signature:

       public void run()

You’re going to put all the work the thread does in this one method. This method may invoke other methods; it may construct other objects; it may even spawn other threads. However, the thread starts here and it stops here. When the run() method completes, the thread dies. In essence, the run() method is to a thread what the main() method is to a traditional nonthreaded program. A single-threaded program exits when the main() method returns. A multithreaded program exits when both the main() method and the run() methods of all nondaemon threads return. Here is an example thread program:

 

class CountingThread extends Thread {

       public CountingThread(int x) {

              this.x =x;

       }

       public void run() {

              int i=0;

              while (i<15) {

                System.out.println(i);

                     i +=x;

              }

       }

       private int x;

}

class CountingThreadExample {

  public static void main(String a[]) {

    CountingThread t1 = new CountingThread(2);

    CountingThread t2 = new CountingThread(3);

    t1.start();

    t2.start();

  }

}

 

To Get Solutions - Call us on Skype

Hits: 2341

Website Development

Website DevelopmentWebsite Development is a broad term that encompasses elements of mark up & coding, server-side scripting, network security, content development, client liaison and other main non-designing aspects of website development..

SEO Services

Best SEO Services in FaridabadSEO is all about the technical analysis of website's underlying codes and architecture, and to optimize it for higher search rankings.

Website Designing

Web Designing-varchas IT systemsYour website should be able to reflect well your overall corporate image and vision. It serves as a dynamic platform, and therefore website designing and development must be given due care and attention that it deserves.