CCCS 529 Selected Topics, Summer 2021 Assignment 05 - Chapter 08,09 Due Wednesday 23 June 2021 10:20 Am

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

CCCS 529 Selected Topics, Summer 2021

Assignment 05– Chapter 08,09


Due Wednesday 23 June 2021 10:20 am

All Assignments should be submitted via Black Board. Late submission will accepted but it
will be reduced by 2 grades for each day after submission deadline. You need to include the
code and a sample run of your program in a single pdf file. Please solve all questions as asked
to get the full grades of the assignment.

1. Write a program that asks the user to enter a series of single-digit numbers (as string)
with nothing separating them. The program should display the sum of all the single digit
numbers in the string. For example, if the user enters 2514, the method should return 12,
which is the sum of 2, 5, 1, and 4. Also, your program should calculate the multiplication
of all the single digit numbers. For example, for the same input 2514, the program should
print 40, which is the multiplication of 2, 5, 1, and 4.

2. Write a program that creates a dictionary containing the World Countries as keys and
their capitals as values. (Use the Internet to get a list of 30 countries and their capitals.)
The program should then randomly quiz the user by displaying the name of a country and
asking the user to enter that country’s capital. The program should keep a counter of the
number of correct and incorrect responses. The user of the game can stop the game and
show their result by press ‘q’ or ‘Q’.
Please do the assignment by yourself, detecting the sheeting at this stage will be
easy.

Good luck and enjoy coding. For any question, please contact me at sghanem@uj.edu.sa

You might also like