Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6365233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:16:04+00:00 2026-05-25T00:16:04+00:00

So my first problem has been fixed here: CLICK HERE Thanks to seanA for

  • 0

So my first problem has been fixed here: CLICK HERE
Thanks to seanA for the quick response…

My Second Problem now is I don’t know how to record the Data the Buyer has ordered
so in the Final Order Display it will show something like this:
CLICK TO VIEW

here’s the updated code of the class PointofSale
Suggest an Addition Method or anything if needed 🙂 Thanks in advance

import java.util.*;
public class PointOfSale extends ProductDisplay
{   public double amount; public double total;
    public PointOfSale()
    {   System.out.print("\nPurchase Item(y/n)?:\t\t");
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        if("y".equalsIgnoreCase(line)){
        OpenOrder();
            }
    }
    //=============================================
    public void OpenOrder() // New Order
    {   ArrayList<String> ProductList = new ArrayList<String>();
        ProductList.add("A001");    ProductList.add("A002");
        ProductList.add("A003");    ProductList.add("A004");
        ProductList.add("A005");
        System.out.print("Enter Product Code:\t\t");
        Scanner sc = new Scanner(System.in);
        String code = sc.next();
        if(ProductList.contains(code))
        { product.getProduct(code); EnterQuantity();        }
        else System.out.print("Product Code is Invalid\n"); System.exit(0);}
    //==============================================
    public void EnterQuantity()  //Entering Quantity
    {
        try{
            System.out.print("Enter Quantity:\t\t\t");
            Scanner sc = new Scanner(System.in);
            int quantity = sc.nextInt();
            amount = quantity * product.getPrice();
            total = total + amount;
            System.out.print("Amount:\t\t\t\t\t" + amount + "\n");
            AddItem(); }
        catch (InputMismatchException nfe)
            {System.out.print("\nInvalid Entry: Input must be a Number.\n"); System.exit(0);}
    }
    //==============================================
    public void AddItem()  //Adding Item
    {
        try{
            System.out.print("Add More Item(y/n)?:\t\t\t");
            Scanner sc = new Scanner(System.in);
            String item = sc.next();
            if("y".equalsIgnoreCase(item)){
            OpenOrder();}
            else if("n".equalsIgnoreCase(item)){
            System.out.print("Total:\t\t" + total + "\n");}
            }
        catch (InputMismatchException nfe)
            {System.out.print("\nInvalid Entry: Input must be a Number.\n"); System.exit(0);}
    }
    // Main Method
    public static void main(String[] args)
    {   new PointOfSale(); }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T00:16:04+00:00Added an answer on May 25, 2026 at 12:16 am

    you need to store the data that you entered in array or use java.util.Vector.

    the use the for loop to display it in the form that you want

    I hope it helps.

    🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This problem has been driving me crazy and Monday mornings don't really help. I'm
First of all: A quite similar problem has been posted and somehow solved already,
Have youI know that the problem has been many times discussed in the web.
UPDATE: First problem solved, second one described at the bottom of this post. UPDATE2:
I have a problem but first i want to know if im working on
First of all, I am aware that this question has been discussed many times
Maybe this has already been answered and I am searching incorrectly, but here is
This problem has been vexing me for a little over a day. The gist
I just solved the first problem from Project Euler in JavaFX for the fun
Currently developing a PHP framework and have ran into my first problem. I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.