Reply
Old 09-23-2011, 01:16 AM   #1 (permalink)
 
Status: Senior Member
Posts: 559



Default Java homework HELP PLEASE!!!

1.Online Book Merchants offers premium customers 1 free book with every purchase of 5 or more books and offers 2 free books with every purchase of 8 or more books. It offers regular customers 1 free book with every purchase of 7 or more books, and offers 2 free books with every purchase of 12 or more books.

Write a statement that assigns freeBooks the appropriate value based on the values of the bool variable isPremiumCustomer and the int variable nbooksPurchased .

2.Given a int variable named yesCount and another int variable named noCount and an int variable named response write the necessary code to read a value into into response and then carry out the following:
if the value typed in is a 1 or a 2 then increment yesCount and print out "YES WAS RECORDED"
if the value typed in is a 3 or an 4 then increment noCount and print out "NO WAS RECORDED"


Any help would be greatly appreciated

bcde561 is offline   Reply With Quote

Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Java homework? HaleyComeau Programming 2 06-16-2013 11:06 AM
java-homework help! got the logic but don't know how to put into java code words? freky8ss Coding 0 05-02-2013 03:06 PM
I need help with this java homework? bobwill Code Generator 1 11-19-2012 11:05 PM
Java Homework Help, Please? ImperialGuard Coding 0 10-04-2012 11:36 AM
help on Java homework Almoxydox Programming 2 05-11-2011 08:36 PM