Search Header Logo
Programming Concepts

Programming Concepts

Assessment

Presentation

Computers

10th Grade

Practice Problem

Hard

Created by

kt geethu

Used 1+ times

FREE Resource

10 Slides • 0 Questions

1

PROGRAMMING CONCEPTS

2

LIBRARY ROUTINES

3

LIBRARY ROUTINES

4

LIBRARY ROUTINES

  • ​Procedure/Subroutine/Function

  • Pre-written block of code that performs a specific task

  • Stored in library and given names

  • Designed to be used frequently.

  • Using library routines make writing programs faster and easier as part of the work has already been done (and debugged).

5

LIBRARY ROUTINES

  • ​DIV

  • MOD

  • RANDOM

  • ROUND

6

LIBRARY ROUTINES

media

​SYNTAX

7

LIBRARY ROUTINES

​SYNTAX

media

​EXAMPLE:
Value3 <--- ROUND(6.97354, 2) returns 6.97

Value4 <--- RANDOM( ) returns 0.2

8

PYTHON CODE EXAMPLES

media
media
media
media

​OUTPUT

​OUTPUT

9

MAINTAINABLE PROGRAM

  • ​Meaningful Identifier names for var,cons,array,procedures and functions

  • Smaller task

  • Comments

​A maintainable program is one that is easy to understand, modify, and debug over time.

10

SCENARIO

Write a pseudocode & python code to simulate a temperature conversion program. Your program should: -

  • Prompt the user to enter a temperature in Celsius.

  • Convert the temperature to Fahrenheit using the formula: F = (C * 9/5) + 32.

  • Use the ROUND function to round the Fahrenheit temperature to two decimal places.

  • Display the rounded Fahrenheit temperature.

  • Use the MOD function to determine if the Fahrenheit temperature is an even or odd number. - Display whether the temperature is even or odd.

PROGRAMMING CONCEPTS

Show answer

Auto Play

Slide 1 / 10

SLIDE