1. Create a variable num and assign it an integer value. a) Implement some code that prints if num is divisible by 5 and/or 3. 1. num is divisible by 3 2. num is divisible by 5 Output Example 15 is divisible by 5. 15 is divisible by 3.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter3: Assignment, Formatting, And Interactive Input
Section3.4: Program Input Using Cin
Problem 9E
icon
Related questions
Question
Please answer in python
1. Create a variable num and assign it an integer value.
a) Implement some code that prints if num is divisible by 5 and/or 3.
1. num is divisible by 3
2. num is divisible by 5
Output Example
15 is divisible by 5.
15 is divisible by 3.
2. Create a variable num and assign it an integer value.
a) Implement some code that prints only one of the following statements based
upon the value of num:
1. num is divisible by 2
2. num is divisible by 4
3. num is not divisible by 2 or 4
Output Example
12 is divisible by 4.
3. Create a variable num and assign it an integer value.
a) Implement some code that prints only one of the following statements based
upon the value of num:
1. num is a positive even integer greater than 50
2. num is a negative odd integer
Output Example
52 is a positive even integer great than 50.
Transcribed Image Text:1. Create a variable num and assign it an integer value. a) Implement some code that prints if num is divisible by 5 and/or 3. 1. num is divisible by 3 2. num is divisible by 5 Output Example 15 is divisible by 5. 15 is divisible by 3. 2. Create a variable num and assign it an integer value. a) Implement some code that prints only one of the following statements based upon the value of num: 1. num is divisible by 2 2. num is divisible by 4 3. num is not divisible by 2 or 4 Output Example 12 is divisible by 4. 3. Create a variable num and assign it an integer value. a) Implement some code that prints only one of the following statements based upon the value of num: 1. num is a positive even integer greater than 50 2. num is a negative odd integer Output Example 52 is a positive even integer great than 50.
e?cmd=view&content_id=_70802049_1&course_id=_21....
4. Create a variable final_grade and assign it a value between 50 and 100.
a) Print the associated letter grade based upon these ranges:
Ⓒ
Between 96 and 100 the letter grade is A
Between 64 and 95 the letter grade is Passing
Below 64 the letter grade is Not Passing
b) Test program with these values for final_grade: 96, 95, 75, 64, 63
Output Example
75 is a grade of Passing.
5. Create a list grades: 95, 63, 80, 53, 90, 56
a) Compute and print the average of all passing grades (64 or better).
Output Example
Average of the passing grades is 88.
6. Create a list comprehension numbers which contains 1 to 30 inclusive.
a) Horizontally print numbers that are multiples of 3 or 5.
b) Horizontally print numbers that are multiples of 3 but not of 5.
numbers that are not ultiples of 3 or 5.
c) Horizontally print
Output Example
3 5 6 9 10 12 15 18 20 21 24 25 27 30
3 6 9 12 18 21 24 27
1 2 4 7 8 11 13 14 16 17 19 22 23 26 28 29
Transcribed Image Text:e?cmd=view&content_id=_70802049_1&course_id=_21.... 4. Create a variable final_grade and assign it a value between 50 and 100. a) Print the associated letter grade based upon these ranges: Ⓒ Between 96 and 100 the letter grade is A Between 64 and 95 the letter grade is Passing Below 64 the letter grade is Not Passing b) Test program with these values for final_grade: 96, 95, 75, 64, 63 Output Example 75 is a grade of Passing. 5. Create a list grades: 95, 63, 80, 53, 90, 56 a) Compute and print the average of all passing grades (64 or better). Output Example Average of the passing grades is 88. 6. Create a list comprehension numbers which contains 1 to 30 inclusive. a) Horizontally print numbers that are multiples of 3 or 5. b) Horizontally print numbers that are multiples of 3 but not of 5. numbers that are not ultiples of 3 or 5. c) Horizontally print Output Example 3 5 6 9 10 12 15 18 20 21 24 25 27 30 3 6 9 12 18 21 24 27 1 2 4 7 8 11 13 14 16 17 19 22 23 26 28 29
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,