module 2_COS-2050_aug19

docx

School

William Paterson University *

*We aren’t endorsed by this school

Course

2050

Subject

Computer Science

Date

Apr 3, 2024

Type

docx

Pages

3

Uploaded by CorporalStraw5558

Report
COS-2050: PYTHON PROGRAMMING Module 2—Computing with Numbers OVERVIEW Module 2 introduces the concept of data types using the data types deployed in Python. More specifically, students learn how numbers are represented on a computer, how to use the Python math library, and how to write programs that process numerical data. TOPICS Module 2 covers the following topics: Python data types Number representation Python math library Accumulator program pattern Processing numerical data OBJECTIVES After successfully completing Module 2, you should be able to: MO2.1 Use Python numeric data types. MO2.2 Use Python math library functions. MO2.3 Write programs that process numerical data. Course objectives covered in this module include CO1 STUDY MATERIALS Textbook Readings Copyright © 2019 by Thomas Edison State University. All rights reserved.
Read Chapter 3 in Zelle, Python Programming . ACTIVITIES Module 2 has two activities. Please consult the Course Calendar for the due dates. Discussion Forum 2 In Discussion Forum 2, post your response to the following discussion question. Reply to at least two classmates’ responses by the date indicated in the Course Calendar. What are the different data types in Python? Discuss some of them with examples. [MO2.1] Programming Assignment 2: Processing Numerical Data Overview In this assignment you will write Python programs that process numerical data. [MO2.1, MO2.2, MO2.3] Directions Part A Write a well-documented (commented) program to calculate the area of a triangle given the length of its three sides a, b, and c, using the following formulas: where A is the area of the triangle. The program should prompt the user for the length of the three sides of the triangle and then print its area. Submit your program as a script file named “COS-2050_assignment2a_<your initials>.py”. Part B Write a well-documented (commented) program to find the sum of the first n natural numbers. The program should prompt the user for the value of n , and then print the sum. Copyright © 2019 by Thomas Edison State University. All rights reserved.
Submit your program as a script file named “COS-2050_assignment2b_<your initials>.py”. Copyright © 2019 by Thomas Edison State University. All rights reserved.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help