Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Python program that prints a square of size depending on an entered value. The program first reads the size of the square and

image text in transcribed
image text in transcribed
Write a Python program that prints a square of size depending on an entered value. The program first reads the size of the square and then prints the square with a pattern according to the examples below. The figure shows two different executions of the program. Submit your solution in q1a.py. [8 marks] Write a Python program that prints a square of size depending on an entered value. The program first reads the size of the square and then prints the square with a pattern according to the examples below. The figure shows two different executions of the program. Submit your solution in q1b.py. [ 10 marks] (c) A stationery shop gives a discount to the univeriaty accordang to the GPA of the stadents. The price list of a pencil case from Super Starionery is given belony. Write a program that reads in the GPA. and then prints the grice. In addition, the program should valudate the input. The following table shows the error message that should be printed for each type of inpat error. The user should be asked to re-enter in case nf an error The following shows an example execution of the program. Submait your solution in qle.py: [10 marks] (d) You are helpang the Mathematics Department to work on statistic research. In the games using two 6-face dice, one of them is purposely replaced with faces of 1,1,2. 3. 4, 5 se that 6 wul never compe out. Assame that you know a normal 6-face die has faces 1,2,3,4,5,6. For curiosity. you wish to know how the ouncoese. which is the sam of throwing the 2 dice (with one of them is a special die). will be. Write a program that rolls two duce of which one of the dice with the above defect. calculate the outcome. collect the statistics and find out the probabilaty of rolling each possible outcomie. Roll 1000 times and then prant out the frequency (mumber of times having each of the outcome values) and also print the correspondang araph. Submit your solution in qld.py. [10 marks] The program should require no inpur. The outpar should look like the example below: Note that due to randomness the exact fregaencies will change. The bar chart should be scaled appropriately for anallysis

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Database Theory Icdt 99 7th International Conference Jerusalem Israel January 10 12 1999 Proceedings Lncs 1540

Authors: Catriel Beeri ,Peter Buneman

1st Edition

3540654526, 978-3540654520

More Books

Students also viewed these Databases questions