CS 1428 Programming Assignment 2 Due Wednesday September 19 th :15 am Section 3 3:45 pm Section 4

Similar documents
Note : Your program must contain the following 6 functions :

Using C++, design an Abstract Data Type class named MyGrades. The class must have the following private members :

Programming Assignment - 1

Fall CS1428 Programming Assignment 7

CMSC 201 Fall 2018 Python Coding Standards

Integer Data Types. Data Type. Data Types. int, short int, long int

! A literal represents a constant value used in a. ! Numbers: 0, 34, , -1.8e12, etc. ! Characters: 'A', 'z', '!', '5', etc.

Overview. - General Data Types - Categories of Words. - Define Before Use. - The Three S s. - End of Statement - My First Program

CS : Programming for Non-majors, Fall 2018 Programming Project #2: Census Due by 10:20am Wednesday September

Honors Introduction to C (COP 3223H) Program 5 Pizza Shack Inventory and Finances

Chapter 2 Basic Elements of C++

Intro to Programming & C Why Program? 1.2 Computer Systems: Hardware and Software. Why Learn to Program?

CS 142 Style Guide Grading and Details

CpSc 1111 Lab 4 Part a Flow Control, Branching, and Formatting

Basic Data Types and Operators CS 8: Introduction to Computer Science, Winter 2019 Lecture #2

Reviewing all Topics this term

ADD Identifier-1 TO Identifier-2 Literal-1. ADD Identifier-1. GIVING Identifier-2 Literal-1

Lecture 2 Tao Wang 1

Fundamentals of Programming Session 4

1. What type of error produces incorrect results but does not prevent the program from running? a. syntax b. logic c. grammatical d.

CS : Programming for Non-majors, Summer 2007 Programming Project #2: Census Due by 12:00pm (noon) Wednesday June

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 3: SEP. 13TH INSTRUCTOR: JIAYIN WANG

LECTURE 02 INTRODUCTION TO C++

King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department

CpSc 1011 Lab 4 Formatting and Flow Control Windchill Temps

CSc Introduction to Computing

Moving Data and Printing Information. The Move Statement has The following Format: Move Identifier-1 To Identifier-2. Move Literal-1 To Identifier-2

Formatting & Style Examples

CSE 1325 Project Description

C++ Style Guide. 1.0 General. 2.0 Visual Layout. 3.0 Indentation and Whitespace

Transactions: Transaction List

VARIABLES & ASSIGNMENTS

Memorandums. Keyboarding Objective 4.03 Apply correct memo and letter formats.

Computer Hardware. Java Software Solutions Lewis & Loftus. Key Hardware Components 12/17/2013

Use of scanf. scanf("%d", &number);

Prepaid Wireless E911 Fee

RADFORD COMPLEX SCHOOLS TECHNOLOGY SCOPE & SEQUENCE GRADES K-6

CS 141, Lecture 3. Please login to the Math/Programming profile, and look for IDLE (3.4 or the unnumbered. <-- fine <-- fine <-- broken

CS 152 Computer Programming Fundamentals Coding Standards

Fundamentals of Programming CS-110. Lecture 2

Problem Solving With C++ Ninth Edition

Spring 2017 CS 1110/1111 Exam 1

CpSc 1011 Lab 5 Conditional Statements, Loops, ASCII code, and Redirecting Input Characters and Hurricanes

Datatypes, Variables, and Operations

Zimmer/Porter CSCI 130 Fall 2018 (191) PROGRAM 5

Identifiers and Variables

CSc 10200! Introduction to Computing. Lecture 2-3 Edgardo Molina Fall 2013 City College of New York

CSE 131 Introduction to Computer Science Fall 2016 Exam I. Print clearly the following information:

Reference Guide APPENDIX A. Business Letter Interoffice Memorandum Report Title Page

Makefiles Makefiles should begin with a comment section of the following form and with the following information filled in:

Grande Prairie Regional College

King Abdulaziz University Faculty of Computing and Information Technology Computer Science Department

How to Create an APA Essay Template in Microsoft Word on a PC

Lecture 02, Fall 2018 Friday September 7

Setting Up a Paper in APA Style Using Microsoft Word 2008 for MACs

Rakuten.com Merchant Manual

Chapter 2: Introduction to C++

POFT 2301 INTERMEDIATE KEYBOARDING LECTURE NOTES

Chapter 2: Special Characters. Parts of a C++ Program. Introduction to C++ Displays output on the computer screen

CpSc 1111 Lab 5 Formatting and Flow Control

7/8/10 KEY CONCEPTS. Problem COMP 10 EXPLORING COMPUTER SCIENCE. Algorithm. Lecture 2 Variables, Types, and Programs. Program PROBLEM SOLVING

Decision Making using the IF Statement. Logical Control Structures

Expanded Guidelines on Programming Style and Documentation

CSCI 1060U Programming Workshop

Expressions, Input, Output and Data Type Conversions

CpSc 1111 Lab 6 Conditional Statements, Loops, the Math Library, and Random Numbers What s the Point?

CpSc 1111 Lab 9 2-D Arrays

Introduction to Programming

Question 2. [2 points] True False By default, structures are passed-by-reference.

Peer Instruction 1. Elementary Programming

ENGINEERING 1020 Introduction to Computer Programming M A Y 2 6, R E Z A S H A H I D I

Ex: If you use a program to record sales, you will want to remember data:

C++ For Science and Engineering Lecture 2

Introduction to Programming EC-105. Lecture 2

2.1. Chapter 2: Parts of a C++ Program. Parts of a C++ Program. Introduction to C++ Parts of a C++ Program

Coding Standards for Java

CSCI 102 Fall 2010 Exam #1

printf( Please enter another number: ); scanf( %d, &num2);

Programming Logic and Design Seventh Edition Chapter 2 Elements of High-Quality Programs

CS 1044 Program 6 Summer I dimension ??????

Programming Style Guide v1.1

PCS1-Ch-3B-Basic-Loops-HW CSCI 1320 Initials P a g e 1

Creating a Business Card. A Tutorial for Catalogue Managers. Customising a Business Card 1

Java Style Guide. 1.0 General. 2.0 Visual Layout. Dr Caffeine

SU2017. LAB 1 (May 4/9) Introduction to C, Function Declaration vs. Definition, Basic I/O (scanf/printf, getchar/putchar)

BIL 104E Introduction to Scientific and Engineering Computing. Lecture 1

Supplement D: Expanded Guidelines on Programming Style and Documentation

Programming Fundamentals. With C++ Variable Declaration, Evaluation and Assignment 1

Chapter 11-D Homework ScalaFX & Eclipse Individual Assignment 10 Points

Lecture Notes. System.out.println( Circle radius: + radius + area: + area); radius radius area area value

CMPSC 111 Introduction to Computer Science I Fall 2016 Lab 2 Assigned: September 7, 2016 Due: Wednesday, September 14, 2016 by 2:30 pm

Creating a C++ Program

Academic assignment presentation and submission

Assignment 1 Expressions Data Types Formatted Printing Variables Scanning CSC 123 Fall 2018 Answer Sheet Short Answers

Differentiate Between Keywords and Identifiers

CS 152: Data Structures with Java Hello World with the IntelliJ IDE

Chapter 2. Designing a Program. Input, Processing, and Output Fall 2016, CSUS. Chapter 2.1

SAMS Programming A/B. Lecture #1 Introductions July 3, Mark Stehlik

CS 251 Intermediate Programming Coding Standards

InFOREMAX RMA Management System 7.0 User s Guide

Transcription:

CS 1428 Programming Assignment 2 Due Wednesday September 19 th 2018 11:15 am Section 3 3:45 pm Section 4 Program 2: Write a C++ program to create a customer s bill for a company. The company sells only five different products. TV, VCR, remote Control, CD Player, and Tape Recorder. The unit prices are $400.00, $220.00, $35.20, $300.00, and $150.00 respectively. The program must read from the keyboard the quantity of each piece of equipment purchased. It then calculates the cost of each item, the subtotal, and the total cost after an 8.25% sales tax. The input data consist of a set of integers representing the quantity as shown below. The number in boldface shows the user s answer How many TV were sold? 3 How many VCR were sold? 5 How many remote controls were sold? 1 How many CD s were sold? 2 How many tape recorders were sold? 4 The format for the output from the program is : QTY DESCRITPTION UNIT PRICE TOTAL PRICE ----- --------------------- ---------------- ------------------ XX TV 400.00 XXXX.XX XX VCR 220.00 XXXX.XX XX REMOTE CONTROL 35.20 XXXX.XX XX CD PLAYER 300.00 XXXX.XX XX TAPE RECORDER 150.00 XXXX.XX -------------- SUBTOTAL XXXX.XX TAX XXX.XX TOTAL XXXX.XX Husain Gholoom Lecturer in Computer Science 1

Note : Use constants for the unit prices and the tax rate. Use integer variables to store the quantities for each item. Use floating-point variables to store the total price for each item, the bill subtotal, the tax amount, and the total amount of the bill. Style Guidelines : At the beginning of your program ( and before the #include statement ), include the following : Header comments (file documentation block) should be at the top of each file and should contain: Author / s, Due Date, Assignment Number, Course number and section, Instructor, and a brief description of the purpose of the code in the file. For example : Author / s : (Your name here!!) Roster Number : Due Date : Programming Assignment Number 2 Fall 2018 - CS 1428 - Section Number Instructor: Husain Gholoom. <Brief description of the purpose of the program> Variable names : Must be meaningful. The initial letter should be lowercase, following words should be capitalized, no other caps or punctuation ( i.e. weightinpounds ). Each variable must be declared on a separate line with a descriptive comment. Husain Gholoom Lecturer in Computer Science 2

Named constants : Use for most numeric literals. All capitals with underscores ( i.e. TX_STATE_SALES_TAX ) Should occur at top of function, or global (only if necessary) Line length of source code should be no longer than 80 characters (no wrapping of lines). Indentation : Use 2-4 spaces (but be consistent throughout your program). Indent blocks, within blocks, etc. Use blank lines to separate sections. Comments for variables : All variable definitions should be commented as follows: int gender; integer value for the gender, 1 = Male, 2 = Female, Remarks: 1. Your program must compile and run using the latest version of Code::Blocks IDE. 2. Your program must be documented according the style above. See the website for the sample programming style program. 3. Must properly format the output by use the appropriate library 4. You must name your program as : 1428_3_F18_PA2_XXXXX_YYYYYY.cpp ( for Section number 3 ) 1428_4_F18_PA2_XXXXX_YYYYYY.cpp ( for Section number 4 ) Where XXXXX is your Last Name and YYYYYY is your First Name. For example, the file name should look something like : 1428_3_F18_PA2_Gholoom_Husain.cpp ( not.cbp ) Husain Gholoom Lecturer in Computer Science 3

You must upload your programs no later than the starting of class time on the due date. No late assignments will be accepted. 11:16 am or 3:46 pm and after will be considered late and will not be accepted. Use TRACS To upload your program 5. You must also turn in hard copy of your source code no later than the starting of class time on the due date. should the hard copy consist of more than one page, then, the hard copy must be stapled. if you are unable to turn in a printout during class, you can take the program to the computer science department and hand it to the front desk personal (Comal 211 ) before the deadline. Make sure that the front office stamps the program. Make sure that include the date and time. Finally,make sure that they place the program in my mailbox. DO NOT slide your program under my office door It will NOT be accepted 6. The following points will be deducted if : Incorrect file format such as uploading.cbp instead of.cpp ( - 10 ) points Compilation Errors ( - 8 points ) Logical Errors ( - 1.25 points ) Incorrect Output format ( - 1.25 points ) Incorrect file name ( - 1.25 points ) Incorrect Style such as Missing Header or footer, missing comments or documentations, hard copy not stapled, hard copy is difficult to read, not using constant variable etc ( - 1.25 points each ) Husain Gholoom Lecturer in Computer Science 4

Sample Run Hi Five Electronic Store How many TV were sold? 3 How many VCR were sold? 5 How many remote controls were sold? 1 How many CD s were sold? 2 How many tape recorders were sold? 4 QTY DESCRITPTION UNIT PRICE TOTAL PRICE ----- --------------------- ---------------- ------------------ 3 TV 400.00 1200.00 5 VCR 220.00 1100.00 1 REMOTE CONTROL 35.20 35.20 2 CD PLAYER 300.00 600.00 4 TAPE RECORDER 150.00 600.00 ---------------- SUBTOTAL 3535.20 TAX 291.65 TOTAL 3826.85 Prepared by Husain Gholoom Husain Gholoom Lecturer in Computer Science 5