首页 > 其他分享 >COSC2391 Further Programming

COSC2391 Further Programming

时间:2024-08-02 20:30:13浏览次数:5  
标签:shopping ebook Programming cart Java book books Further COSC2391

COSC2391 Further Programming/COSC1295 Advanced Programming

Assignment 1 – Semester 2 2024

Introduction

You are required to implement a basic Java program using Java. This assignment is designed to:

•    Test your knowledge of basic Java concepts.

•    Evaluate your ability to design programming logic.

• Practice simple object design in Java.

This is an individual assignment. Your final submission is worth 15%; a simple demo in Week 4 is worth a further 3%, giving a total of 18% for Assignment 1.

Academic Integrity (more)

The submitted assignment must be your own work. No marks will be awarded for any work which is not created by you.

Plagiarism is treated very seriously at RMIT. Plagiarism includes copying code directly from other students (or enables such copying), the internet, the output of AI systems, or other resources without proper reference. Sometimes, students’ study and work on assignments together and submit similar  files which may be regarded as plagiarism. Please note that y ou should always create your own assignment even if you have very similar ideas. Plagiarism-detection tools will be used to check all submissions. Penalties may be applied in cases of plagiarism.

The Reading Room Book Shop

You are to implement a book purchasing system, called “The Reading Room” . The system keeps a list of books that can be purchased (in physical and/or ebook form) as follows.

 

 

•    Each book has limited number of physical copies. You will track the number of available physical copies of each book. If the user tries to buy a (physical) book and there are no copies available, then the system outputs an error message.

•    Some (not all) books are available in ebook form. There is no limit of copies for ebooks. If the ebook exists for a book, then there is always a copy of the ebook available.

• All physical books cost $50.00; all ebooks cost $8.00.

•    The user can request purchasing a book by specifying a keyword: the system lists all books that contain the keyword, along with the number of copies and ebook availability. The user chooses which form. of the book they want: if the book is available then it gets added to the user’s “shopping cart” . Note that keyword matching is not case-sensitive here.

• The user can view and update the shopping cart.

• The user can print the full list of books and their availability.

•    Once the user is finished selecting books, the user can “checkout and pay”; the system prints the final total price and updates the number of copies of each book.

• The user can quit the system (before or after paying).

Assumptions and Simplifications.

1.  All prices as per Australian currency denominations.

2.  Correct input can be assumed in this assignment.  Error handling is not required.

Part A

Implement the above specifications without necessarily using object-oriented design at this stage. The key focus is to implement the correct algorithm logic. You can implement the system in one main program in a single class (Note: you may skip Part A and go straight to Part B with the use of OO. Part A is designed to let you focus on the basic functionalities.)

Following is a possible sample interaction with the bookstore system. You do not have to strictly follow the format but it illustrates required functionality. Text in bold and green is input from the user:

=============================================== Welcome to The Reading Room!

===============================================

Choose an option:

1. Add a book to shopping cart

2. View shopping cart

3. Remove a book from shopping cart

4. Checkout

5. List all books

6. Quit

Please select: 1

Enter a keyword: Java concepts

Sorry! There are no books that match with your key word.

Choose an option:

1. Add a book to shopping cart

2. View shopping cart

3. Remove a book from shopping cart

4. Checkout

5. List all books

6. Quit

Please select: 1

Enter a keyword: java

The following book (s) are found:

1. Absolute Java

2. JAVA: How to program

3. Computing Concepts with Java 8 Essentials

4. Java Software Solutions

5. Java Program Design

6. Cancel

Please select: 2

Do you want to buy this as an ebook: no

Sorry! There are no physical copies of the book!

Choose an option:

1. Add a book to shopping cart

2. View shopping cart

3. Remove a book from shopping cart

4. Checkout

5. List all books

6. Quit

Please select: 1

Enter a keyword: Computing

The following books are found:

1. Computing Concepts with JAVA 8 Essentials

2. Cancel

Please select: 1

Do you want to buy this as an ebook: no

“Computing Concepts with JAVA 8 Essentials” has been added to your cart.

Choose an option:

1. Add a book to shopping cart

2. View shopping cart

3. Remove a book from shopping cart

4. Checkout

5. List all books

6. Quit

Please select: 2

Your shopping cart contains the following book (s):

1. Computing Concepts with JAVA 8 Essentials

Choose an option:

1. Add a book to shopping cart

2. View shopping cart

3. Remove a book from shopping cart

4. Checkout

5. List all books

6. Quit

Please select: 3

Your shopping cart contains the following book (s):

1. Computing Concepts with JAVA 8 Essentials

2. Cancel

What do you want to remove: 1

Item removed from shopping cart

Choose an option:

1. Add a book to shopping cart

2. View shopping cart

3. Remove a book from shopping cart

4. Checkout

5. List all books

6. Quit

Please select: 1

Enter a keyword: Absolute

The following book (s) are found:

1. Absolute Java

2. Cancel

Please select: 1

Do you want to buy this as an ebook: no

“Absolute Java” has been added to your cart.

Choose an option:

1. Add a book to shopping cart

2. View shopping cart

3. Remove a book from shopping cart

4. Checkout

5. List all books

6. Quit

Please select: 4

You have purchased items to the total value of $50.00. Thanks for shopping with The Reading Room!

Choose an option:

1. Add a book to shopping cart

2. View shopping cart

3. Remove a book from shopping cart

4. Checkout

5. List all books

6. Quit

Please select: 5

The following books are available:

1. Absolute Java, 4 copies, ebook available

2. JAVA: How to Program, 0 copies, ebook available

3. Computing Concepts with JAVA 3 Essentials, 5 copies, no ebook

4. Java Software Solutions, 5 copies, no ebook

5. Java Program Design, 1 copy, ebook available

Choose an option:

1. Add a book to shopping cart

2. View shopping cart

3. Remove a book from shopping cart

4. Checkout

5. List all books

6. Quit

Please select: 6 Goodbye!

Part B

The aim of Part B is to incorporate basic object-oriented concepts into your program and test main

functionality. In particular, define a Book class that contains all information related to a book title, including the title, author (this is new!), number of physical copies, and ebook availability. Using the OO solution, you should only use ONE ARRAY---an array of Book objects.

The only change to the functionality is that when you print list of books, you list both title and author, as well as number of copies and ebook availability (see example output below).

NOTE1: it is OK to start using Object Oriented concepts from the start of the assignment if you prefer--- i.e. it is not a requirement to complete Part A before introducing OO.

===============================================

Welcome to The Reading Room!

===============================================

Choose an option:

1. Add a book to shopping cart

2. View shopping cart

3. Remove a book from shopping cart

4. Checkout

5. List all books

6. Quit

Please select: 1

Enter a keyword: Java

The following book (s) are found:

1. Absolute Java | Savitch | 5 copies | yes

2. JAVA: How to program | Deitel and Deitel | 0 | yes

3. Computing Concepts with JAVA 8 Essentials | Horstman | 5 | no

4. Java Software Solutions | Lewis and Loftus | 5 | no

5. Java Program Design | Cohoon and Davidson | 1 | yes

6. Cancel

Please select: 2

Do you want to buy this as an ebook: no

Sorry! There are no physical copies of the book!

Choose an option:

1. Add a book to shopping cart

2. View shopping cart

3. Remove a book from shopping cart

4. Checkout

5. List all books

6. Quit

Please select: 5

The following books are available:

1. Absolute Java | Savitch | 5 copies | yes

2. JAVA: How to program | Deitel and Deitel | 0 | yes

3. Computing Concepts with JAVA 8 Essentials | Horstman | 5 | no

4. Java Software Solutions | Lewis and Loftus | 5 | no

5. Java Program Design | Cohoon and Davidson | 1 | yes

 

标签:shopping,ebook,Programming,cart,Java,book,books,Further,COSC2391
From: https://www.cnblogs.com/vx-codehelp/p/18339538

相关文章

  • Lab0 C Programming Lab(CMU)(CSAPP深入理解计算机系统)
    该文章是我在别处写的小随笔,现在转过来实验下载地址15-213/14-513/15-513:IntrotoComputerSystems,Spring2022大致要求1.Linux命令行基础2.C语言基础3.数据结构基础(链表基本操作)4.基本英语阅读能力大致操作下载.tar文件,解压后对着README操作即可;简单来说,允许直......
  • Python - Functional programming
    Functionalprogrammingisaprogrammingparadigminwhichmostoftheworkinaprogramisdoneusingpurefunctions.Apurefunctionisafunctionwithoutanysideeffects;itsreturnvalueisalwaysdeterminedbyitsinputarguments,soitalwaysreturn......
  • 《Programming from the Ground Up》阅读笔记:p88-p94
    《ProgrammingfromtheGroundUp》学习第5天,p88-p94总结,总计7页。一、技术总结1.touppercase.s#PURPOSE:Thisprogramconvertsaninputfile#toanoutputfilewithallletters#convertedtouppercase.#PROCESSING:#(1)Opentheinputfile#(2)Opentheoutput......
  • 动态规划(Dynamic programming)
    什么是动态规划?动态规划(英语:Dynamicprogramming,简称DP),是一种在数学、管理科学、计算机科学经济学和生物信息学中使用的,通过把原问题分解为相对简单的子问题的方式求解复杂问题的方法。动态规划常常适用于有重叠子问题和最优子结构性质的问题。以上定义来自维基百科,看定义感觉还......
  • COMP1921 Programming Module
    SchoolofComputing:AssessmentbriefModuletitleProgrammingProjectModulecodeCOMP1921AssignmenttitleResitAssessmentAssignmenttypeanddescriptionYouwillproducecodetomeetagivenspecification.RationaleThisassessmentgivesyoua......
  • CPT206 Computer Programming for Financial
    CPT206ComputerProgrammingforFinancialMathematics:CourseworkResitTaskSpecificationThomasSeligSet:Monday,22July,2024Duedate:Sunday,4August,2024,23:59ThisisthespecificationtasksheetfortheCourseworkresitassessmentofyourC......
  • CS50P: 8. Object-Oriented Programming
    Object-OrientedProgrammingturpleAtupleisasequenceofvalues.Unlikealist,atuplecan’tbemodified.can'tbemodified:tupleobjectdoesnotsupportitemassignment不能赋值Likex,y,zdefmain():name,house=get_student()print(f&qu......
  • CMP-7000A - Applications Programming
    Module: CMP-7000A- Applications ProgrammingAssignment: R002-Game Coding and Testing PresentationLearningoutcomes•    Youwilldemonstratecompetence in using Pythonprogrammingskills by creatingandcodingyourown personalgameappl......
  • COMP9021 Principles of Programming
    COMP9021PrinciplesofProgrammingTerm2,2024Assignment2Worth13marksanddueWeek11Monday@10amGeneralMatters1.1AimThepurposeofthisassignmentisto:Developyourproblem-solvingskills.Designandimplementthesolutiontoapr......
  • COMP9021 Principles of Programming Coding Quiz 5
     COMP9021PrinciplesofProgrammingTerm2,2024CodingQuiz5Worth4marksanddueWeek8Thursday@9pmDescriptionYouareprovidedwithastubinwhichyouneedtoinsertyourcodewhereindicatedwithoutdoinganychangestotheexistingcode......