Java Project 3 In Class Practice. IF Statements Create a simple program that allows the user to enter a test score as an integer. If the test score is.

Slides:



Advertisements
Similar presentations
Work with Data and Decision Structure. Murach’s Java SE 6, C3© 2007, Mike Murach & Associates, Inc. Slide 2.
Advertisements

Logic & program control part 3: Compound selection structures.
Chapter Seven PAYROLL AND INCOME TAX Copyright © 2014 by The McGraw-Hill Companies, Inc. All rights reserved.McGraw-Hill/Irwin.
Chapter 3 IFTHENELSE Control Structure © 2008 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. Marilyn Bohl/Maria Rynn Tools for Structured.
Subject: Information Technology Grade: 10
CONTROL STRUCTURES: SEQUENTIAL, SELECTIVE, AND REPETITIVE
1 Lab Session-6 CSIT-121 Spring 2005 Structured Choice The do~While Loop Lab Exercises.
An Introduction to Programming with C++ Fifth Edition Chapter 8 More on the Repetition Structure.
Chapter 3 Applications & Logical Constructs. 2 Application 1 Temperature Conversion: Write a program that will convert a Celsius temperature to the corresponding.
Exponential Growth and Exponential Decay
CENTURY 21 ACCOUNTING © Thomson/South-Western LESSON 3-1 Completing Payroll Records for Employee Earnings and Deductions Modified by D. Burns West Johnston.
CENTURY 21 ACCOUNTING © Thomson/South-Western LESSON 3-1 Completing Payroll Records for Employee Earnings and Deductions.
Presented by Joaquin Vila Prepared by Sally Scott ACS 168 Problem Solving Using the Computer Week 12 Boolean Expressions, Switches, For-Loops Chapter 7.
Made By:. This tutorial makes the assumption that you have already downloaded the “WV State Employment Calculator” Excel file to your computer and saved.
CENTURY 21 ACCOUNTING © Thomson/South-Western LESSON 3-1 Completing Payroll Records for Employee Earnings and Deductions.
PAYROLL ACCOUNTING. WHAT IS PAYROLL?  Payroll – total amount earned by all employees for a pay period.  Pay Period – an amount of time over which an.
Spreadsheets Spreadsheets. What is a spreadsheet? A spreadsheet is a program used for performing calculations on tables of numbers. It can also often.
First tutorial.
Chapter 5 Repetition or loop structure. What is repetition or loop? repeat the execution of one or a group (block; instruction enclosed in a pair of braces)
Selection Structure If... Then.. Else Case. Selection Structure Use to make a decision or comparison and then, based on the result of that decision or.
Problem Solving with Decisions
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers William J. Palm.
Writing Program Code in BASIC Write a program to prompt for and accept values into TWO variables, numx and numy. The program should square the value stored.
PROBLEM SOLVING & ALGORITHMS CHAPTER 5: CONTROL STRUCTURES - SELECTION.
Procedural Programming. Programming Process 1.Understand the problem 2.Outline a general solution 3.Decompose the general solution into manageable component.
Writing JavaScript Functions. Goals By the end of this unit, you should understand … How to breakdown applications into individual, re-usable modules.
Conditional Structures UNIVERSITY OF THE PUNJAB (GUJRANWALA CAMPUS) ADNAN BABAR MT14028 CR
BACS 287 Programming Logic 2. BACS 287 Sequence Construct The sequence construct is the default execution mode for the CPU. The instructions are executed.
Computer Programming TCP1224 Chapter 8 More On Repetition Structure.
Payroll Accounting Making Accounting Relevant Businesses issue payroll checks to their employees to compensate them for work performed. Making Accounting.
Chapter 12 Payroll Accounting
Chapter 4 Selection: the if-else and switch-case instructions.
Agenda Basic Logic Purpose if statement if / else statement
Chapter 1 Gross Pay.
CENTURY 21 ACCOUNTING © Thomson/South-Western 1 LESSON 12-1 CHAPTER 12 OBJECTIVES PREPARING PAYROLL RECORDS DEFINE TERMS RELATED TO PAYROLL RECORDS COMPLETE.
CENTURY 21 ACCOUNTING © 2009 South-Western, Cengage Learning LESSON 12-1 Preparing Payroll Time Cards  Paying employees  Analyzing a payroll time card.
CENTURY 21 ACCOUNTING © 2009 South-Western, Cengage Learning LESSON 12-1 Preparing Payroll Time Cards.
Selection Structures: if and switch Statements. 2 Selection Statements –In this chapter we study statements that allow alternatives to straight sequential.
Control Structures RepetitionorIterationorLooping Part I.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
1 SELECTION using IF and IF-ELSE Chapter 4. 2 Agenda Background  One Way selection (if) Two Way selection (if-else) Compound Statements Nested if-else.
Decision Structures and Boolean Variables. Sequence Structures Thus far, we’ve been programming “sequence structures” Thus far, we’ve been programming.
Computer Programming TCP1224 Chapter 5 The Selection Structure.
Decisions Action based on condition. Examples Simple condition: –If total sales exceeds $300 then applies 5% discount; otherwise, no discount. More than.
An Introduction to Programming with C++ Sixth Edition Chapter 12 Two-Dimensional Arrays.
Topics: Selection Statements. Processing Involving Selecting Instructions An instruction that allows deviation and selection to take place uses the ‘IF’
Lecture 7: Menus and getting input. switch Multiple-selection Statement switch Useful when a variable or expression is tested for all the values it can.
CS 101 – Oct. 7 Solving simple problems: create algorithm Structure of solution –Sequence of steps (1,2,3….) –Sometimes we need to make a choice –Sometimes.
An Introduction to Programming with C++ Sixth Edition Chapter 5 The Selection Structure.
4 - Conditional Control Structures CHAPTER 4. Introduction A Program is usually not limited to a linear sequence of instructions. In real life, a programme.
Programming Simple Programming If and Nested Statements.
IF Function Decision: Action based on condition. Examples SF State Tuition calculation: –
Intelligent Data Systems Lab. Department of Computer Science & Engineering Practices 컴퓨터의 개념 및 실습 4 월 25 일.
PRG 420 Week 2 Individual Simple Commission Calculation Program Part 1 To purchase this material click below link
PRG 420 Week 4 Individual Write a simple commission calculation program using IDE. To purchase this material click below link
An Introduction to Programming with C++ Sixth Edition
Chapter 5: Control Structure
The order in which statements are executed is called the flow of control. Most of the time, a running program starts at the first programming statement,
For Monday Read WebCT quiz 18.
Control Statement Examples
For Wednesday No new reading No quiz.
LESSON 12-1 Preparing Payroll Time Cards
ANALYZING A PAYROLL TIME CARD
Chapter 7 Conditional Statements
LESSON 12-1 Preparing Payroll Time Cards
LESSON 12-1 Preparing Payroll Time Cards
Print a list of all people in department 15 who either are salaried and make more than or are part time or full time and make more than 25 per hour.
ANALYZING A PAYROLL TIME CARD
Presentation transcript:

Java Project 3 In Class Practice

IF Statements Create a simple program that allows the user to enter a test score as an integer. If the test score is greater than 85, the user should get the feedback – “You Passed” Otherwise the user should get the feedback “Sorry, try again”

Payroll program – page 221 of Adobe file Follow the program guidelines to set up a program to determine pay of employees Constant – full time hours worked per week Constant – overtime rate – 1.5 (allows this to be changed easily)

Nested IF statement Instructions in handout, page 223, 224 Follow instructions below figure 5-11 In the program the amount of bonus depends not only on the number of items sold, but the value of each item. Good practice with Nested IF

Switch Statements Use the Switch statements to set up a program to allow the user to Enter a number 1 – 4. If they enter a 1, it should report – Freshman If they enter a 2, it should report – Sophomore If they enter a 3, it should report – Junior If they enter a 4, it should report – Senior If they enter anything other than 1 -4 they should get a message that it is an invalid choice.

Conditional statements Two variables – GPA and ACT score. If the GPA is greater than 3.65 or the ACT score is greater than 27, Admission to Madison is granted Otherwise tell the user to try again.

Constants – determining amount of commission Allow the user to enter a salesperson’s Amount of sale Set up a program with a commission rate as a constant A variable to calculate the amount of the commission Amount of Sale * Commission Rate Print back the amount of the Commission