// Display the prediction. System.out.println("Ampara district sales prediction: $" + eastcoastsales);

Size: px
Start display at page:

Download "// Display the prediction. System.out.println("Ampara district sales prediction: $" + eastcoastsales);"

Transcription

1 Exercise 01 public class SumOfTwoNumbers int number1, number2, total; number1 = 62; number2 = 99; total = number1 + number2; // Assign the first number // Assign the second number // Calculate the sum Exercise 02 public class SalesPrediction double totalsales = ; // Total sales double amparasales; // Ampara district sales // Calculate Ampara district sales. amparasales = totalsales * 0.62; // Display the prediction. System.out.println("Ampara district sales prediction: $" + eastcoastsales); Exercise 03 public class NameAgeAnnualIncome String name; // To hold a name int age; // To hold an age double annualincome; // To hold annualincome // Store values in the String object and variables. name = "Sams SaNa"; age = 33; annualincome = ; // Display a message. System.out.println("My name is " + name + ", my age is " + age + " and I hope to earn Rs." +annualincome+ " per year."); Fundamentals of Programming by S. Sabraz Nawaz Page 1

2 Exercise 04 public class PersonalInformation // The "\n" is an escapte character used to create a new line System.out.println("Sabraz Nawaz\n" + "124 Main Street\n" + "Sainthamaruthu-01, EP 32280\n" + "(077) \n" + "Information Systems"); Exercise 05 public class NameAndInitials String firstname = "Sabraz"; // First name String middlename = "Nawaz"; // Middle name String lastname = "Samsudeen"; // Last name char firstinitial; char middleinitial; char lastinitial; // To hold the first initial // To hold the middle initial // To hold the last initial // Get the initials. firstinitial = firstname.charat(0); middleinitial = middlename.charat(0); lastinitial = lastname.charat(0); // Display the contents of the variables. System.out.println("Name: " + firstname + " " + middlename + " " + lastname); System.out.println("Initials: " + firstinitial + middleinitial + lastinitial); Exercise 06 (Constants) public class StockCommission // Constants final int NUM_SHARES = 600; // Number of shares final double STOCK_PRICE = 21.77; // Price per share final double COMM_PERCENT = 0.02; // Commission percentage double stockcost; // Cost of stock double commission; // Commission double total; // Total of the transaction // Calculate the stock cost. stockcost = STOCK_PRICE * NUM_SHARES; // Calculate the commission. commission = stockcost * COMM_PERCENT; Fundamentals of Programming by S. Sabraz Nawaz Page 2

3 MIT 11053, Lab sheet #02 // Calculate the total. total = stockcost + commission; System.out.println("Stock cost: Rs." + stockcost); System.out.println("Commission: Rs." + commission); System.out.println("Total: Rs." + total); Exercise 07 public class EnergyDrinks // Constant for the number surveyed final int NUM_SURVEYED = 12467; // Constant for the percentage who purchase // energy drinks final double ENERGY_DRINKERS_PCT = 0.14; // Constant for the percentage of energy drinkers // who prefer citrus flavor final double PREFER_CITRUS_PCT = 0.64; double energydrinkers; // Number of energy drinkers double prefercitrus; // Number that prefer citrus // Calculate the number of energy drinkers. energydrinkers = NUM_SURVEYED * ENERGY_DRINKERS_PCT; // Calculate the number of energy drinkers that // prefer citrus flavor. prefercitrus = energydrinkers * PREFER_CITRUS_PCT; System.out.println("We surveyed " + NUM_SURVEYED + " people."); System.out.println("Out of those surveyed, approximately " + energydrinkers + " purchase at least one " + "energy drink per year."); System.out.println("Approximtely " + prefercitrus + " of those " + "prefer citrus flavored energy drinks."); Exercise 08 import java.util.scanner; // Needed for the Scanner class public class TestAverage double test1; // Test score #1 double test2; // Test score #2 double test3; // Test score #3 double average; // Average of the test scores Fundamentals of Programming by S. Sabraz Nawaz Page 3

4 MIT 11053, Lab sheet #02 // Create a Scanner object for keyboard input. // Get the first test score. System.out.print("Enter test score #1: "); test1 = keyboard.nextdouble(); // Get the second test score. System.out.print("Enter test score #2: "); test2 = keyboard.nextdouble(); // Get the third test score. System.out.print("Enter test score #3: "); test3 = keyboard.nextdouble(); // Calculate the average. average = (test1 + test2 + test3) / 3.0; // Display the average. System.out.println("Test average: " + average); Exercise 09 import java.util.scanner; public class RestaurantBill // Constants final double TAX_RATE = ; // Tax rate final double TIP_PERCENT = 0.15; // Tip percentage double mealcharge; // To hold the meal charge double tax; // To hold the amount of tax double tip; // To hold the tip amount double total; // To hold the total charge // Create a Scanner object for keyboard input. // Get the charge for the meal. System.out.print("Enter the charge for the meal: "); mealcharge = keyboard.nextdouble(); // Calculate the tax. tax = mealcharge * TAX_RATE; // Calculate the tip. tip = mealcharge * TIP_PERCENT; // Calculate the total. total = mealcharge + tax + tip; System.out.println("Meal Charge: $" + mealcharge); Fundamentals of Programming by S. Sabraz Nawaz Page 4

5 MIT 11053, Lab sheet #02 System.out.println("Tax: $" + tax); System.out.println("Tip: $" + tip); System.out.println("Total: $" + total); Exercise 10 (Using Scanner class and Constants) import java.util.scanner; // Needed for the Scanner class public class SalesTax // Constants final double STATE_RATE = 0.04; // State tax rate final double COUNTY_RATE = 0.02; // County tax rate double purchase; double statetax; double countytax; double totaltax; double totalcost; // Amount of purchase // Amount of state sales tax // Amount of county sales tax // Total sales tax // Total cost of the purchase // Create a Scanner object for keyboard input. // Get the amount of the purchase. System.out.print("Enter the purchase amount: "); purchase = keyboard.nextdouble(); // Calculate the state sales tax. statetax = purchase * STATE_RATE; // Calculate county sales tax. countytax = purchase * COUNTY_RATE; // Calculate the total sales tax. totaltax = statetax + countytax; // Calculate the total purchase cost. totalcost = purchase + totaltax; System.out.println("Purchase amount: Rs." + purchase); System.out.println("State tax: Rs." + statetax); System.out.println("County tax: Rs." + countytax); System.out.println("Total tax: Rs." + totaltax); System.out.println("Total cost: Rs." + totalcost); Fundamentals of Programming by S. Sabraz Nawaz Page 5

6 Exercise 11 public class StockTransaction // Named constants final int NUM_SHARES = 1000; // Number of shares final double PURCHASE_PRICE = 32.87; // Purchase price per share final double SELLING_PRICE = 33.92; // Selling price per share final double BROKER_COMM_RATE = 0.02; // Broker commission rate // Calculate the cost of the stock (without the // broker's commission) and store the result // in stockpurchase. double stockpurchase = (NUM_SHARES * PURCHASE_PRICE); // Calculate the broker's commission on the purchase and // store the result in purchasecomm. double purchasecomm = stockpurchase * BROKER_COMM_RATE; // Calculate the total amount SaNa paid for the stock plus the // broker's commission and store the result in amountpaid. double amountpaid = stockpurchase + purchasecomm; // Calculate the amount SaNa sold the stock for and store // the result in stocksale. double stocksale = NUM_SHARES * SELLING_PRICE; // Calculate the broker's commission on the sale and // store the result in sellingcomm. double sellingcomm = (NUM_SHARES * SELLING_PRICE) * BROKER_COMM_RATE; // Calculate the amount that SaNa actually recieved after // selling the stock and paying his broker the sales // commission, and store the result in amountrecieved. double amountrecieved = stocksale - sellingcomm; // Calculate the amount of profit or loss, and store the // result in profitorloss. If a profit was made, the amount // will be positive. If a loss was incurred, the amount // will be negative. double profitorloss = amountrecieved - amountpaid; System.out.println("SaNa paid Rs." + stockpurchase + " for the stock."); System.out.println("SaNa paid his broker a commission of Rs." + purchasecomm + " on the purchase."); System.out.println("So, SaNa paid a total of Rs." + amountpaid + "\n"); System.out.println("SaNa sold the stock for Rs." + stocksale); System.out.println("SaNa paid his broker a commission of Rs." + sellingcomm + " on the sale."); System.out.println("So, SaNa recieved a total of Rs." + amountrecieved + "\n"); System.out.println("SaNa's profit or loss: Rs." + profitorloss); Fundamentals of Programming by S. Sabraz Nawaz Page 6

7 Exercise 12(String Manipulation) public class NameAndInitials String firstname = "Sabraz"; // First name String middlename = "Nawaz"; // Middle name String lastname = "Samsudeen"; // Last name char firstinitial; char middleinitial; char lastinitial; // To hold the first initial // To hold the middle initial // To hold the last initial // Get the initials. firstinitial = firstname.charat(0); middleinitial = middlename.charat(0); lastinitial = lastname.charat(0); // Display the contents of the variables. System.out.println("Name: " + firstname + " " + middlename + " " + lastname); System.out.println("Initials: " + firstinitial + middleinitial + lastinitial); Exercise 13 import java.util.scanner; // Needed for the Scanner class public class StringManipulator String city; // To hold user input System.out.print("Enter the name of your favorite city: "); city = keyboard.nextline(); System.out.println("Number of characters: " + city.length()); System.out.println(city.toUpperCase()); System.out.println(city.toLowerCase()); System.out.println(city.charAt(0)); Fundamentals of Programming by S. Sabraz Nawaz Page 7

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

Assignment 1 Expressions Data Types Formatted Printing Variables Scanning CSC 123 Fall 2018 Answer Sheet Short Answers Assignment 1 Expressions Data Types Formatted Printing Variables Scanning CSC 123 Fall 2018 Answer Sheet Short Answers 1. Every complete statement ends with a c. a. period b. parenthesis c. semicolon d.

More information

Chapter 1 Lab Algorithms, Errors, and Testing

Chapter 1 Lab Algorithms, Errors, and Testing Chapter 1 Lab Algorithms, Errors, and Testing Lab Objectives Be able to write an algorithm Be able to compile a Java program Be able to execute a Java program using the Sun JDK or a Java IDE Be able to

More information

Full file at https://fratstock.eu

Full file at https://fratstock.eu Full file at https://fratstock.eu Solutions to Exercises (Chapters 1 through 4) Dawn Ellis and Frank M. Carrano Chapter 1 Exercises 1. What is volatile and nonvolatile memory? Volatile is a property of

More information

Lab 2: Modules This lab accompanies Chapter 3 of Starting Out with Programming Logic & Design.

Lab 2: Modules This lab accompanies Chapter 3 of Starting Out with Programming Logic & Design. Starting Out with Programming Logic and Design 1 Lab 2: Modules This lab accompanies Chapter 3 of Starting Out with Programming Logic & Design. Lab 2.1 Algorithms Name: This lab requires you to think about

More information

Chapter 2 Input, Processing and Output. Hong Sun COSC 1436 Spring 2017 Jan 30, 2017

Chapter 2 Input, Processing and Output. Hong Sun COSC 1436 Spring 2017 Jan 30, 2017 Chapter 2 Input, Processing and Output Hong Sun COSC 1436 Spring 2017 Jan 30, 2017 Designing a Program Designing a Program o Programs must be carefully designed before they are written. Before beginning

More information

Full file at

Full file at Chapter 1 1. a. False; b. False; c. True; d. False; e. False; f; True; g. True; h. False; i. False; j. True; k. False; l. True. 2. Keyboard and mouse. 3. Monitor and printer. 4. Because programs and data

More information

Console Input and Output

Console Input and Output Solutions Manual for Absolute C++ 4th Edition by Walter Savitch Link full download Test bank: https://getbooksolutions.com/download/test-bank-for-absolute-c-4th-edition-by-savitch/ Link full download Solutions

More information

Lesson 02 Data Types and Statements. MIT 11053, Fundamentals of Programming By: S. Sabraz Nawaz Senior Lecturer in MIT Department of MIT FMC, SEUSL

Lesson 02 Data Types and Statements. MIT 11053, Fundamentals of Programming By: S. Sabraz Nawaz Senior Lecturer in MIT Department of MIT FMC, SEUSL Lesson 02 Data Types and Statements MIT 11053, Fundamentals of Programming By: S. Sabraz Nawaz Senior Lecturer in MIT Department of MIT FMC, SEUSL Topics Covered Statements Variables Data Types Arithmetic

More information

Chapter 3 Lab Decision Structures

Chapter 3 Lab Decision Structures Chapter 3 Lab Decision Structures Lab Objectives Be able to construct boolean expressions to evaluate a given condition Be able to compare String objects Be able to use a flag Be able to construct if and

More information

Task #1 The if Statement, Comparing Strings, and Flags

Task #1 The if Statement, Comparing Strings, and Flags Chapter 3 Lab Selection Control Structures Lab Objectives Be able to construct boolean expressions to evaluate a given condition Be able to compare Strings Be able to use a flag Be able to construct if

More information

ShipRite s Account Receivable Instructions

ShipRite s Account Receivable Instructions ShipRite s Account Receivable Instructions Setting up a new account Click on the POS button Enter the existing customer s PHONE number here. If they are in the database, their information will appear at

More information

https://unicenta.com/ OPOS 3.9.x v.1 User Training Guide for unicenta 3.9.x version Created by: Mariam Ali Page 1 of 15

https://unicenta.com/ OPOS 3.9.x v.1 User Training Guide for unicenta 3.9.x version Created by: Mariam Ali Page 1 of 15 User Training Guide for unicenta 3.9.x version Created by: Mariam Ali Page 1 of 15 Contents 1) Introduction... 3 2) Software Installation... 3 3) Database Setup... 4 4) Product Categories... 5 4.1) Product

More information

What two elements are usually present for calculating a total of a series of numbers?

What two elements are usually present for calculating a total of a series of numbers? Dec. 12 Running Totals and Sentinel Values What is a running total? What is an accumulator? What is a sentinel? What two elements are usually present for calculating a total of a series of numbers? Running

More information

Over and Over Again GEEN163

Over and Over Again GEEN163 Over and Over Again GEEN163 There is no harm in repeating a good thing. Plato Homework A programming assignment has been posted on Blackboard You have to convert three flowcharts into programs Upload the

More information

Chapter 5 Lab Methods

Chapter 5 Lab Methods Chapter 5 Lab Methods Lab Objectives Be able to write methods Be able to call methods Be able to write javadoc comments Be able to create HTML documentation for our Java class using javadoc Introduction

More information

for Diane Christie University of Wisconsin Stout

for Diane Christie University of Wisconsin Stout LAB MANUAL for Diane Christie University of Wisconsin Stout Addison-Wesley New York Boston San Francisco London Toronto Sydney Toyko Singapore Madrid Mexico City Munich Paris Cape Town Hong Kong Montreal

More information

Lesson 02 Data Types and Statements. MIT 12043, Fundamentals of Programming By: S. Sabraz Nawaz Senior Lecturer in MIT Department of MIT FMC, SEUSL

Lesson 02 Data Types and Statements. MIT 12043, Fundamentals of Programming By: S. Sabraz Nawaz Senior Lecturer in MIT Department of MIT FMC, SEUSL Lesson 02 Data Types and Statements MIT 12043, Fundamentals of Programming By: S. Sabraz Nawaz Senior Lecturer in MIT Department of MIT FMC, SEUSL Topics Covered Statements Variables Constants Data Types

More information

ICT WORKSHEET GRADE 9 TERM1 EXAMINATION

ICT WORKSHEET GRADE 9 TERM1 EXAMINATION ICT WORKSHEET GRADE 9 TERM1 EXAMINATION Q1. (A) Give the most suitable device and one advantage and disadvantage of suggested method to (i) Input sound. (ii) Insert a hand-drawn map into a document (iii)

More information

Chapter 5 Lab Methods

Chapter 5 Lab Methods Chapter 5 Lab Methods Lab Objectives Be able to write methods Be able to call methods Be able to write javadoc comments Be able to create HTML documentation using the javadoc utility Introduction Methods

More information

Analyzing invoice data

Analyzing invoice data Analyzing invoice data The paid invoice data can be analysed and used in many ways.. on in the main menu to open the window with paid invoices. In the upper part of the window is the filter section, where

More information

Lecture 6. Assignments. Summary - Variables. Summary Program Parts 1/29/18. Reading: 3.1, 3.2, 3.3, 3.4

Lecture 6. Assignments. Summary - Variables. Summary Program Parts 1/29/18. Reading: 3.1, 3.2, 3.3, 3.4 Assignments Lecture 6 Complete for Project 1 Reading: 3.1, 3.2, 3.3, 3.4 Summary Program Parts Summary - Variables Class Header (class name matches the file name prefix) Class Body Because this is a program,

More information

Lecture 6. Assignments. Java Scanner. User Input 1/29/18. Reading: 2.12, 2.13, 3.1, 3.2, 3.3, 3.4

Lecture 6. Assignments. Java Scanner. User Input 1/29/18. Reading: 2.12, 2.13, 3.1, 3.2, 3.3, 3.4 Assignments Reading: 2.12, 2.13, 3.1, 3.2, 3.3, 3.4 Lecture 6 Complete for Lab 4, Project 1 Note: Slides 12 19 are summary slides for Chapter 2. They overview much of what we covered but are not complete.

More information

Lesson 06 Arrays. MIT 11053, Fundamentals of Programming By: S. Sabraz Nawaz Senior Lecturer in MIT Department of MIT FMC, SEUSL

Lesson 06 Arrays. MIT 11053, Fundamentals of Programming By: S. Sabraz Nawaz Senior Lecturer in MIT Department of MIT FMC, SEUSL Lesson 06 Arrays MIT 11053, Fundamentals of Programming By: S. Sabraz Nawaz Senior Lecturer in MIT Department of MIT FMC, SEUSL Array An array is a group of variables (called elements or components) containing

More information

Software and Programming 1

Software and Programming 1 Software and Programming 1 Lab 7: Construction of a Simulated Cash Register and a Student Class 28 February 2019 SP1-Lab7-2018-19.ppt Tobi Brodie (Tobi@dcs.bbk.ac.uk) 1 Coursework Plagiarism Plagiarism

More information

Lesson 7 Part 2 Flags

Lesson 7 Part 2 Flags Lesson 7 Part 2 Flags A Flag is a boolean variable that signals when some condition exists in a program. When a flag is set to true, it means some condition exists When a flag is set to false, it means

More information

Building Java Programs. Chapter 2: Primitive Data and Definite Loops

Building Java Programs. Chapter 2: Primitive Data and Definite Loops Building Java Programs Chapter 2: Primitive Data and Definite Loops Copyright 2008 2006 by Pearson Education 1 Lecture outline data concepts Primitive types: int, double, char (for now) Expressions: operators,

More information

Software and Programming 1

Software and Programming 1 Software and Programming 1 Lab 7: Construction of a Simulated Cash Register and a Student Class 22 February 2018 SP1-Lab7-2018.ppt Tobi Brodie (Tobi@dcs.bbk.ac.uk) 1 Coursework Plagiarism Plagiarism is

More information

MIT Database Management Systems Lesson 03: Entity Relationship Diagrams

MIT Database Management Systems Lesson 03: Entity Relationship Diagrams MIT 22033 Database Management Systems Lesson 03: Entity Relationship Diagrams By S. Sabraz Nawaz Senior Lecturer in MIT, FMC, SEUSL & A.J.M.Hasmy FMC, SEUSL ER - Model The entity-relationship (ER) data

More information

ACS-1903 Basic program structure Feb 16, 2017

ACS-1903 Basic program structure Feb 16, 2017 Problem: Suppose we need a program to calculate someone s net pay. For input the program requires a name, gross pay, deductions and a tax rate. The output comprises the name, gross pay, deductions, taxes

More information

CS 102 Lab 3 Fall 2012

CS 102 Lab 3 Fall 2012 Name: The symbol marks programming exercises. Upon completion, always capture a screenshot and include it in your lab report. Email lab report to instructor at the end of the lab. Review of built-in functions

More information

Homework Assignment 3. November 9th, 2017 Due on November 23th, 11:59pm (midnight) CS425 - Database Organization Results

Homework Assignment 3. November 9th, 2017 Due on November 23th, 11:59pm (midnight) CS425 - Database Organization Results Name CWID Homework Assignment 3 November 9th, 2017 Due on November 23th, 11:59pm (midnight) CS425 - Database Organization Results Please leave this empty! 3.1 3.2 3.3 Sum Instructions Try to answer all

More information

Input. Scanner keyboard = new Scanner(System.in); String name;

Input. Scanner keyboard = new Scanner(System.in); String name; Reading Resource Input Read chapter 4 (Variables and Constants) in the textbook A Guide to Programming in Java, pages 77 to 82. Key Concepts A stream is a data channel to or from the operating system.

More information

Dynamics GP SmartList Lab. Matt Mason

Dynamics GP SmartList Lab. Matt Mason Dynamics GP SmartList Lab Matt Mason mmason@manersolutions.com Exercise 1 - Warmup Exercise Income Statement Accounts Open SmartList Screen: Microsoft Dynamics GP SmartList Choose + next to Financial

More information

CSIS 10A Assignment 4 SOLUTIONS

CSIS 10A Assignment 4 SOLUTIONS CSIS 10A Assignment 4 SOLUTIONS Read: Chapter 4 Choose and complete any 10 points from the problems below, which are all included in the download file on the website. Use BlueJ to complete the assignment,

More information

PRACTICAL EXERCISE 1.1.6b

PRACTICAL EXERCISE 1.1.6b PRACTICAL EXERCISE 1.1.6b PLAN, SELECT & USE APPROPRIATE IT SYSTEMS & SOFTWARE 1. Explain the purpose for using IT. EXPLAIN THE PURPOSE FOR USING IT a) Explain the type of document that is to be produced

More information

Variables and Assignments CSC 121 Fall 2015 Howard Rosenthal

Variables and Assignments CSC 121 Fall 2015 Howard Rosenthal Variables and Assignments CSC 121 Fall 2015 Howard Rosenthal Lesson Goals Understand variables Understand how to declare and use variables in Java Programs Learn how to formulate assignment statements

More information

A+ Computer Science -

A+ Computer Science - import java.util.scanner; or just import java.util.*; reference variable Scanner keyboard = new Scanner(System.in); object instantiation Scanner frequently used methods Name nextint() nextdouble() nextfloat()

More information

CSC 1051 Algorithms and Data Structures I. Midterm Examination February 26, Name: Key

CSC 1051 Algorithms and Data Structures I. Midterm Examination February 26, Name: Key CSC 1051 Algorithms and Data Structures I Midterm Examination February 26, 2015 Name: Key Question Value 1 10 Score 2 10 3 10 4 10 5 10 6 10 7 10 8 10 9 10 10 10 TOTAL 100 Please answer questions in the

More information

Chapter 5 Lab Methods

Chapter 5 Lab Methods Gaddis_516907_Java 4/10/07 2:10 PM Page 41 Chapter 5 Lab Methods Objectives Be able to write methods Be able to call methods Be able to write javadoc comments Be able to create HTML documentation for our

More information

Program Development. To know what are instance variables and class variables.

Program Development. To know what are instance variables and class variables. Program Development Objectives To know what are instance variables and class variables. To know when to use instance variables as oppose to when to use class variables. To know what are instance methods

More information

Decision Structures. Lecture 3 MIT 12043, Fundamentals of Programming By: S. Sabraz Nawaz

Decision Structures. Lecture 3 MIT 12043, Fundamentals of Programming By: S. Sabraz Nawaz Decision Structures Lecture 3 MIT 12043, Fundamentals of Programming By: S. Sabraz Nawaz Chapter Topics o Relational Operators o The if Statement o The if-else Statement o Nested if statements o The if-else-if

More information

2017 INFORMATION RETURNS SPECIFICATIONS FOR ELECTRONIC FILING COMMA SEPARATED VALUE (CSV) FORMAT

2017 INFORMATION RETURNS SPECIFICATIONS FOR ELECTRONIC FILING COMMA SEPARATED VALUE (CSV) FORMAT KANSAS DEPARTMENT OF REVENUE 2017 INFORMATION RETURNS SPECIFICATIONS FOR ELECTRONIC FILING COMMA SEPARATED VALUE (CSV) FORMAT The Kansas Department of Revenue will not accept 1099 Informational Returns

More information

I S B N

I S B N Peachtree Update 7/20/06 10:43 AM Page 1 I S B N 0-7638-2945-5 9 780763 829452 Peachtree Update 7/19/06 3:48 PM Page 2 ISBN-13: 978-0-7638-2945-2 ISBN-10: 0-7638-2945-5 2007 by EMC Publishing, a division

More information

Basic Computation. Chapter 2

Basic Computation. Chapter 2 Basic Computation Chapter 2 Outline Variables and Expressions The Class String Keyboard and Screen I/O Documentation and Style Variables Variables store data such as numbers and letters. Think of them

More information

Building Java Programs

Building Java Programs Building Java Programs Chapter 2 Lecture 2-1: Expressions and Variables reading: 2.1-2.2 1 2 Data and expressions reading: 2.1 3 The computer s view Internally, computers store everything as 1 s and 0

More information

! definite loop: A loop that executes a known number of times. " The for loops we have seen so far are definite loops. ! We often use language like

! definite loop: A loop that executes a known number of times.  The for loops we have seen so far are definite loops. ! We often use language like Indefinite loops while loop! indefinite loop: A loop where it is not obvious in advance how many times it will execute.! We often use language like " "Keep looping as long as or while this condition is

More information

Transactions: Transaction List

Transactions: Transaction List Transactions Transactions: Transaction List Purpose The Transaction List allows you to view transactions for selected dates; create new transactions; open, edit or delete existing transactions; open client

More information

COMM 391 Winter 2014 Term 1. Tutorial 1: Microsoft Excel - Creating Pivot Table

COMM 391 Winter 2014 Term 1. Tutorial 1: Microsoft Excel - Creating Pivot Table COMM 391 Winter 2014 Term 1 Tutorial 1: Microsoft Excel - Creating Pivot Table The purpose of this tutorial is to enable you to create Pivot Table to analyze worksheet data in Microsoft Excel. You should

More information

CSCI 1101 Winter 2017 Laboratory No Submission deadline is p.m. (5 minutes to midnight) on Saturday, February 4th, 2017.

CSCI 1101 Winter 2017 Laboratory No Submission deadline is p.m. (5 minutes to midnight) on Saturday, February 4th, 2017. CSCI 1101 Winter 2017 Laboratory No. 3 This lab is a continuation of the concepts of object-oriented programming, specifically the use of static variables and static methods, and object interactions. If

More information

Conditional Execution

Conditional Execution Unit 3, Part 3 Conditional Execution Computer Science S-111 Harvard University David G. Sullivan, Ph.D. Review: Simple Conditional Execution in Java if () { else {

More information

SETTING UP THE SYSTEM

SETTING UP THE SYSTEM SETTING UP THE SYSTEM L O G G I N G I N Once the Thin Clients or Single User system is successfully installed, double click on the Thin Client or Single User to Log In. The Log In Screen below should appear.

More information

Building Java Programs

Building Java Programs Building Java Programs Chapter 2 Lecture 2-1: Expressions and Variables reading: 2.1-2.2 1 Data and expressions reading: 2.1 self-check: 1-4 videos: Ch. 2 #1 2 Data types type: A category or set of data

More information

I 27, Discover 42 1, Diners!C.B TTL CREDIT CARDS 36,965.65

I 27, Discover 42 1, Diners!C.B TTL CREDIT CARDS 36,965.65 Bar I Daily Consolidated System Sales Detail Period From: 07/01/2012 To : 07/31/2012 Printed on Wednesday, August 01, 2012-5:02 AM 62,298.87 Returns Voids 0 187-1,417.04 Gross Receipts Charged Receipts

More information

Conditional Programming

Conditional Programming COMP-202 Conditional Programming Chapter Outline Control Flow of a Program The if statement The if - else statement Logical Operators The switch statement The conditional operator 2 Introduction So far,

More information

Oct Decision Structures cont d

Oct Decision Structures cont d Oct. 29 - Decision Structures cont d Programming Style and the if Statement Even though an if statement usually spans more than one line, it is really one statement. For instance, the following if statements

More information

Decision Structures. Lesson 03 MIT 11053, Fundamentals of Programming

Decision Structures. Lesson 03 MIT 11053, Fundamentals of Programming Decision Structures Lesson 03 MIT 11053, Fundamentals of Programming By: S. Sabraz Nawaz M.Sc. in IS (SLIIT), PGD in IS (SLIIT), BBA (Hons.) Spl. In IS (SEUSL), MIEEE, Microsoft Certified Professional

More information

Basic Computation. Chapter 2

Basic Computation. Chapter 2 Walter Savitch Frank M. Carrano Basic Computation Chapter 2 Outline Variables and Expressions The Class String Keyboard and Screen I/O Documentation and Style Variables Variables store data such as numbers

More information

Building Java Programs

Building Java Programs Building Java Programs Chapter 2 Lecture 2-1: Expressions and Variables reading: 2.1-2.2 Copyright 2009 by Pearson Education Data and expressions reading: 2.1 self-check: 1-4 videos: Ch. 2 #1 Copyright

More information

CSE 1223: Introduction to Computer Programming in Java Chapter 1 Computer Basics

CSE 1223: Introduction to Computer Programming in Java Chapter 1 Computer Basics CSE 1223: Introduction to Computer Programming in Java Chapter 1 Computer Basics 1 Computer Basics Computer system: hardware + software Hardware: the physical components Software: the instructions that

More information

CHAPTER 6: Scatter plot, Correlation, and Line of Best Fit

CHAPTER 6: Scatter plot, Correlation, and Line of Best Fit CHAPTER 6: Scatter plot, Correlation, and Line of Best Fit Name: Date: 1. A baseball coach graphs some data and finds the line of best fit. The equation for the line of best fit is y = 0.32x.51, where

More information

QuickSwipe Web User Guide

QuickSwipe Web User Guide QuickSwipe Web User Guide Bluefin Payment Systems Release 12/20/2013 Table of Contents Table of Contents... 1 Overview... 3 Log In... 3 Management... 5 Users... 5 Adding Users... 6 Editing Users... 8 Deleting

More information

Basic Computation. Chapter 2

Basic Computation. Chapter 2 Basic Computation Chapter 2 Increment and Decrement Operators Used to increase (or decrease) the value of a variable by 1 Easy to use, important to recognize The increment operator count++ or ++count The

More information

Sequential Program Execution

Sequential Program Execution Sequential Program Execution Quick Start Compile step once always g++ -o Realtor1 Realtor1.cpp mkdir labs cd labs Execute step mkdir 1 Realtor1 cd 1 cp../0/realtor.cpp Realtor1.cpp Submit step cp /samples/csc/155/labs/1/*.

More information

What methods does the String class provide for ignoring case sensitive situations?

What methods does the String class provide for ignoring case sensitive situations? Nov. 20 What methods does the String class provide for ignoring case sensitive situations? What is a local variable? What is the span of a local variable? How many operands does a conditional operator

More information

AFTER HOURS EMERGENCY POS SUPPORT ext 126 Press 4 when prompted

AFTER HOURS EMERGENCY POS SUPPORT ext 126 Press 4 when prompted AFTER HOURS EMERGENCY POS SUPPORT 519-442-3153 ext 126 Press 4 when prompted TEC REGISTER POS Operations Manual A complete guide to the operations of the point-of-sale (POS) unit. Calendar Club of Canada

More information

COP 5725 Fall Hospital System Database and Data Interface. Term Project

COP 5725 Fall Hospital System Database and Data Interface. Term Project COP 5725 Fall 2016 Hospital System Database and Data Interface Term Project Due date: Nov. 3, 2016 (THU) Database The database contains most of the information used by the web application. A database is

More information

Variables and Assignments CSC 121 Spring 2017 Howard Rosenthal

Variables and Assignments CSC 121 Spring 2017 Howard Rosenthal Variables and Assignments CSC 121 Spring 2017 Howard Rosenthal Lesson Goals Understand variables Understand how to declare and use variables in Java Programs Learn how to formulate assignment statements

More information

Final Exam Review (Revised 3/16) Math MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

Final Exam Review (Revised 3/16) Math MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. Final Exam Review (Revised 3/16) Math 0001 Name MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. Evaluate. 1) 1 14 1) A) 1 B) 114 C) 14 D) undefined

More information

Algorithms (continued)

Algorithms (continued) Algorithms (continued) QUIZ What are the 3 (or 4) fundamental control structures that we use as building blocks for algorithms? Building blocks for algorithms Sequential Actions (input, output, computations)

More information

Program Control Flow

Program Control Flow Lecture slides for: Chapter 3 Program Control Flow Java Actually: A Comprehensive Primer in Programming Khalid Azim Mughal, Torill Hamre, Rolf W. Rasmussen Cengage Learning, 2008. ISBN: 978-1-844480-933-2

More information

Program Control Flow

Program Control Flow Lecture slides for: Chapter 3 Program Control Flow Java Actually: A Comprehensive Primer in Programming Khalid Azim Mughal, Torill Hamre, Rolf W. Rasmussen Cengage Learning, 2008. ISBN: 978-1-844480-933-2

More information

Problem Solving. Chapter Problem Solving. Analysis (inquiry, examination, study) Goal

Problem Solving. Chapter Problem Solving. Analysis (inquiry, examination, study) Goal Chapter 1 Problem Solving Goal Introduce a three step process that outlines the development of a program that runs on a computer. Show an example of a good old-fashioned console input/output program. 1.1

More information

Loops and Files. Chapter 04 MIT 12043, Fundamentals of Programming By: S. Sabraz Nawaz

Loops and Files. Chapter 04 MIT 12043, Fundamentals of Programming By: S. Sabraz Nawaz Loops and Files Chapter 04 MIT 12043, Fundamentals of Programming By: S. Sabraz Nawaz Chapter Topics o The Increment and Decrement Operators o The while Loop o Shorthand Assignment Operators o The do-while

More information

Structs and Interfaces

Structs and Interfaces Structs and Interfaces Structs and Interfaces Objectives Create structs as lightweight value-type objects. Create interfaces as contracts for classes to fulfill. Instantiate interfaces. Pass interfaces

More information

Part V. Arrays and Pointers

Part V. Arrays and Pointers Part V Arrays and Pointers C++ 23 By EXAMPLE Introducing Arrays This chapter discusses different types of arrays. You are already familiar with character arrays, which are the only method for storing

More information

Event Night Card Reader

Event Night Card Reader Event Night Card Reader There are three possible scenarios at event check-in: 1. Pre-registered Guests: Bidders who have registered for the event in advance, including on-line registrations. 2. New Bidders

More information

The for Loop, Accumulator Variables, Seninel Values, and The Random Class. CS0007: Introduction to Computer Programming

The for Loop, Accumulator Variables, Seninel Values, and The Random Class. CS0007: Introduction to Computer Programming The for Loop, Accumulator Variables, Seninel Values, and The Random Class CS0007: Introduction to Computer Programming Review General Form of a switch statement: switch (SwitchExpression) { case CaseExpression1:

More information

Terry Riley. G Song. Sample begins on following page. SchirmerOnDemand G. Schirmer's Library of Digital Perusal Scores

Terry Riley. G Song. Sample begins on following page. SchirmerOnDemand   G. Schirmer's Library of Digital Perusal Scores SchirmerOnDemand http://digital.schirmer.com/ G. Schirmer's Library of Digital Perusal Scores Terry Riley Sample begins on following page Score for sale from G. Schirmer Rental Library See last page for

More information

Reports & Updates. Chapter 10

Reports & Updates. Chapter 10 Reports & Updates Chapter 10 Chapter 10 Reports & Updates The Service Reports/Updates menu is used to run service reports and to perform a monthly update of your service data. Almost all of the reports

More information

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

Intro to Programming & C Why Program? 1.2 Computer Systems: Hardware and Software. Why Learn to Program? Intro to Programming & C++ Unit 1 Sections 1.1-4 and 2.1-10, 2.12-13, 2.15-17 CS 1428 Spring 2019 Jill Seaman 1.1 Why Program? Computer programmable machine designed to follow instructions Program a set

More information

A+ Computer Science -

A+ Computer Science - Visit us at www.apluscompsci.com Full Curriculum Solutions M/C Review Question Banks Live Programming Problems Tons of great content! www.facebook.com/apluscomputerscience import java.util.scanner; Try

More information

System Setup. Accessing the Setup. Chapter 1

System Setup. Accessing the Setup. Chapter 1 System Setup Chapter 1 Chapter 1 System Setup When you create deals, certain pieces of standard information must be entered repeatedly. Continually entering the same information takes time and leaves you

More information

Evaluating the Style of your programs

Evaluating the Style of your programs Evaluating the Style of your programs Objectives At the end of this exercise, students will: Roles Be able to evaluate a program for conformance to style guide for the class. Be able to evaluate arithmetic

More information

COSC 236 Section 101 Computer Science 1 -- Prof. Michael A. Soderstrand

COSC 236 Section 101 Computer Science 1 -- Prof. Michael A. Soderstrand COSC 236 Section 101 Computer Science 1 -- Prof. Michael A. Soderstrand COSC 236 Web Site You will always find the course material at: http://www.class-notes.us or http://www.class-notes.info or http://www.lecture-notes.tripod.com

More information

Wentworth Institute of Technology. Engineering & Technology WIT COMP1000. Java Basics

Wentworth Institute of Technology. Engineering & Technology WIT COMP1000. Java Basics WIT COMP1000 Java Basics Java Origins Java was developed by James Gosling at Sun Microsystems in the early 1990s It was derived largely from the C++ programming language with several enhancements Java

More information

TEST 1 CS 1410 Intro. To Computer Science Name KEY. October 13, 2010 Fall 2010

TEST 1 CS 1410 Intro. To Computer Science Name KEY. October 13, 2010 Fall 2010 TEST 1 CS 1410 Intro. To Computer Science Name KEY October 13, 2010 Fall 2010 Part I: Circle one answer only. (2 points each) 1. The decimal representation of binary number 11011 2 is a) 19 10 b) 29 10

More information

ZSRestWEB. Start Guide. BackOffice. Start Guide of ZSRestWeb

ZSRestWEB. Start Guide. BackOffice. Start Guide of ZSRestWeb 1 ZSRestWEB Start Guide BackOffice 2 Introduction 3 ZSRestWeb starting 4 Add a Shortcut 4 Sign in ZSRestWEB 5 ZSRestWEB appearance 6 Widgets 7 Example of Widget in a Table: 8 Example of Widget in a Graphic:

More information

ICSE Class 10 Computer Applications ( Java ) 2010 Solved Question...

ICSE Class 10 Computer Applications ( Java ) 2010 Solved Question... 1 of 12 05-11-2015 16:23 ICSE J Java for Class X Computer Applications ICSE Class 10 Computer Applications ( Java ) 2010 Solved Question Paper COMPUTER APPLICATIONS (Theory) Two Hours Answers to this Paper

More information

CustomerTRAX Product Overview. VoIP Agent 1 / 10

CustomerTRAX  Product Overview. VoIP Agent 1 / 10 Product Overview VoIP Agent 1 / 10 Table Of Contents VoIP integration to Handle Agent... 3 How screen pops work with the Handle agent... 5 Searching on Agent... 6 Account overview (Agent)... 7 Agent -

More information

Building Java Programs

Building Java Programs Building Java Programs Chapter 4 Lecture 4-3: Strings; char; printf; procedural design reading: 3.3, 4.3, 4.5 1 Strings reading: 3.3 1 Strings string: An object storing a sequence of text characters. Unlike

More information

2.4 Solving Linear Equations

2.4 Solving Linear Equations 2.4 Solving Linear Equations When we are solving equations, we are attempting to isolate the variable in order to determine what specific value that variable has in the given equation. We do this using

More information

1-1. Variables and Expressions

1-1. Variables and Expressions exploration Catherine s dance team is planning a spring trip to the coast. Catherine is saving money in a bank account to pay for the trip. Her parents started her account with $100. She sells Christmas

More information

TWIN BUTTE ENERGY LTD. Stock Dividend Program FREQUENTLY ASKED QUESTIONS

TWIN BUTTE ENERGY LTD. Stock Dividend Program FREQUENTLY ASKED QUESTIONS TWIN BUTTE ENERGY LTD. Stock Dividend Program FREQUENTLY ASKED QUESTIONS The following frequently asked questions and answers explain some of the key features of the Twin Butte Energy Ltd. ("Twin Butte"

More information

What does the dispute button do, can I use it? Your p-card is a credit card. You may not receive cash advances through the card.

What does the dispute button do, can I use it? Your p-card is a credit card. You may not receive cash advances through the card. Table of Contents FAQ... 2 Is my purchasing card a credit card or debit card?... 2 What is an itemized receipt?... 2 I forgot to get an itemized receipt, what do I do?... 2 I lost my itemized receipt,

More information

Topic 4 Expressions and variables

Topic 4 Expressions and variables Topic 4 Expressions and variables "Once a person has understood the way variables are used in programming, he has understood the quintessence of programming." -Professor Edsger W. Dijkstra Based on slides

More information

Methods CSC 121 Spring 2017 Howard Rosenthal

Methods CSC 121 Spring 2017 Howard Rosenthal Methods CSC 121 Spring 2017 Howard Rosenthal Lesson Goals Understand what a method is in Java Understand Java s Math Class and how to use it Learn the syntax of method construction Learn both void methods

More information

BASIC INPUT/OUTPUT. Fundamentals of Computer Science

BASIC INPUT/OUTPUT. Fundamentals of Computer Science BASIC INPUT/OUTPUT Fundamentals of Computer Science Outline: Basic Input/Output Screen Output Keyboard Input Simple Screen Output System.out.println("The count is " + count); Outputs the sting literal

More information

Expressions, Input, Output and Data Type Conversions

Expressions, Input, Output and Data Type Conversions L E S S O N S E T 3 Expressions, Input, Output and Data Type Conversions PURPOSE 1. To learn input and formatted output statements 2. To learn data type conversions (coercion and casting) 3. To work with

More information

Artists please read this information so that you are aware of which artist pack to select to apply for The Dunedin Art Show.

Artists please read this information so that you are aware of which artist pack to select to apply for The Dunedin Art Show. Artists please read this information so that you are aware of which artist pack to select to apply for The Dunedin Art Show. Before you register for The Dunedin Art Show please make sure that you have

More information

Chapter 5: Programming in Java

Chapter 5: Programming in Java Chapter 5: Programming in Java Practice Questions ----------------------------->Objective-Type Questions

More information