CIS 6 :: Lab 02 - Syntax/Semantics
CIS6作业代写 1. Identify the parts of the chaos program as follows: Color code each: identifier, expression, statement, reserved words.
Task 1: Definitions & Concepts
Instructions: Answer the questions below. Press [Shift + Enter] after each question to answer. CIS6作业代写
1. Why is it a good idea to first write out an algorithm in pseudocode rather than jumping immediately to Python code?
- Programming Elements:
a. Write three names that are legal identifiers:
b. Write three names that are illegal identifies:
c. Write three name that are legal identifiers but not good practices: CIS6作业代写
a. What is an expressions:
b. Write an example expression:
- Syntax vs. Convention:
- Use the table below to list three syntax rule examples and three good programming practices (conventions)
- Apply six steps in the software development process to the below program Problem: Write a program that asks users to enter a US Dollar amount and converts it to Euros and outputs the result
Task 2: Understanding Programming CIS6作业代写
- Identify the parts of the chaos program as follows: Color code each: identifier, expression, statement, reserved words.
# File: chaos.py
# A simple program illustrating chaotic behavior.
print("This program illustrates a chaotic function")
x = eval(input("Enter a number between 0 and 1: "))
for i in range(10):
x = 3.9 * x * (1 - x)
- Show the output from the following fragments (you can write your output in a single line separated by a space): CIS6作业代写
a. for i in range(5):
print(i * i)
b. for d in [3,1,4,1,5]:
print(d, end=" ")