Java | JSP | JSF Answers

Questions: 3 611

Answers by our Experts: 3 611

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

4. Write a program (without using an array) that accepts three numbers from the user and prints "increasing" if the numbers are in increasing order, "decreasing" if the numbers are in decreasing order, and "Neither increasing or decreasing order" otherwise.



Example: Input first number: 1524


Input second number: 2345


Input third number: 3321



Expected Output :



Increasing order



Create a project to model student with firstname, lastname, age, gender and student number. Create two construtors, one to be used as default and another to include all attributes. Add a class attribute to keep count of all registered students. Use the class attribute to generate student numbers with the following format 22201XYZ, where XYZ is the current count provided by the class attribute. Implement the respective getters and setters for each attribute.  2. In plane geometry, the x- and y axis of a 2D Cartesian system divide it into four infinite regions called quadrants. Your task is to model each point with an x-value and y-value. Apart from the constructors, getters and setters, implement a getQuadrant method to determine the region in which a given point falls. 


Construct a simple purchasing program based on the Requirement Below.

Main.java should only contain the main method and a Reference of Purchase Object. Purchase.java should contain this fields & Methods:


Fields/Instance Variables

-itemName : String

-itemPrice : double

-itemQuantity : int

-amountDue :double


Methods

setItemName(String itemName) : void

setTotalCost(int quantity, double price) : void

getItemName(): String

getTotalCost(): double

readInput():void

writeOutput(): void

Note: The readinput() method will be used to accept user input through the Scanner class.


Create a class named Exponent. Its main() method accepts an integer value from a user at the keyboard, and in turn passes the value to a method that squares the number (multiplies it by itself) and to a method that cubes the number (multiplies it by itself twice). The main() method displays the results. Create the two methods that respectively square and cube an integer that is passed to them, returning the calculated value. Save the application as Exponent.java


. Write an application that displays all even numbers from 2 to 100 inclusive, and that starts a new line after every multiple of 20 (20, 40, 60, and 80). Save the file as EvenNums.java.


1.1 A Retail has name, a List containing Items available in the stock and another List containing sold items. [2] 1.2 A Retail have functionality to view available stock, that prints Class name of item, name of Item, size of item and total number of items that have same name, and size. [5] EXAMPLE

ClassName Item name Size Drink coke 1 Drink coke 2

Total

10; // this show that in the list there are 10 coke that are size of 1

5; // this show that in the list there are 5 coke that are size 2 Sizes in drinks means litres.

Hint: Items are the same if their class name, item name and size are the same.

1.3. A retail Shop has a functionality to add item into the stock list. The add item takes a parameter the Item to be added on stock. [2] 1.4 A retail shop also has a functionality to calculate total sales that returns double sum of money made from all sold items. [2]



A car model class under package:package 3 with the following attributes

1.9.

1.9.1 In a main class, instantiate one object of Type Retail. [2] 1.9.2 Instantiate two objects of each Item [Drink, Detergent, Diary] you can use your own instance variables. [2] 1.9.3 Using the Retail shop method, add these items in the Item stock. [2] 1.9.4 Display the available stock.


1.7 All Items have item name, item size, item price, expiryDate (use LocalDate class for this) . Item fall into the following categories: Drink, Diary, and Detergent.

Drink items have an additional variable a string that shows what type of drink : “fizzy drink” and “fruit drink”.

Dairy has storage Temperature, this is a recommended storage temperature.

Detergent have a string indicating “liquid” or “powder” or “bar”. [5] 1.8 Item has function to view number of days left before expiry. viewExpiry( )

returns an int number of days left before expiry. [2] If this number is less than or equal to 1, print in capital letters that ITEM EXPIRED


A retail shop have functionality to sell. The sell function must take item name, and size as a parameter. Removes the item from the stock and put that Item in the sold list. The sell function also displays the sold item details, name, size, and days before expiry date. [2] If item is not available in the stock a message must be displayed on the screen “no stock”;

1.6 An Items class need to be created in order to implement a complete Retail Shop. All items MUST/ FORCED to have the getPrice() function returns price of an item , setPrice(double price), returns nothing, but set a price of an Item.


LATEST TUTORIALS
APPROVED BY CLIENTS