Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Given the comments, write a python code: Subprogram writeNameAssn() Write My name is: Write This is assignment:

Given the comments, write a python code: Subprogram writeNameAssn() Write "My name is: "  Write "This is assignment: " End Subprogram Subprogram getPosInt() Declare n as Integer Declare done as Boolean done = False While not done Write "Enter a positive integer: " Input n If n < 0 Then Write "The value you entered is not a positive integer" Else done = True End While Return n end Subprogram Main Call writeNameAssn() *** hint: google "python 3 modulus" *** Write "Enter a number greater than 5." count = getPosInt() For (i = 1; i < count + 1; i++) If i % 2 > 0 Then Write "The value " + i + " is odd." Else Write "The value " + i + " is even." End If End For End Main 

-----------

Sample out put should look like this:

My name is Username This is assignment 4 
Enter a number greater than 5. Enter a positive integer: 6 The value 1 is odd. The value 2 is even. The value 3 is odd. The value 4 is even. The value 5 is odd. The value 6 is even. 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions