70 likes | 83 Views
This document provides a framework for problem analysis, program design, coding, testing, debugging, maintenance, and documentation in computer programming. It includes steps and elements involved in the programming life cycle.
E N D
PROBLEM SOLVING 1.2 Problem Solving Prepared by : Pn Nurul Zakiah Binti Kasnun @ IT Department
PROGRAMMING LIFE CYCLE • Programming Life Cycle: A framework or discipline, which uses certain techniques needed in computer programming development.
PROBLEM ANALYSIS PROGRAM DESIGN PROGRAM CODING TESTING AND DEBUGGING MAINTENANCE DOCUMENTATION Steps involved in programming life cycle:
ELEMENTS of PROBLEM ANALYSIS • Purpose : To describe in detail a solution to a problem and information needed in solving the problem. • Elements : • Input • Process • Output
Problem 1: Write a program that will get 3 numbers as input from the users. Find the average and display the three numbers and its average. • Problem Analysis: Input: 3 numbers. Process: 1. Add the three numbers 2. Divide the total of the three numbers with 3 Output: The three numbers and its average
Exercises • Write a program that will get length and width for a rectangle as input from the users. Find the area and display the length, width and its area. • Write a program that will calculate and display the sum of multiplication of 3 numbers. • Write a program that will get weight of rice in gram unit as input. Program will convert to kilogram and display the weight of rice in kilogram.
Cont..Exercises • Write a program that calculate and display average for 3 integers. • Write a program that will get length of wire in cm unit as input. Program will convert to meter and display the length of wire in cm and meter.