Menu

[solved]-Write Program Comments T O F O L L O W N G 4 Ask U S E R T O E N T E R P O S T V E N T E Q38987517

Write a program , with comments , t o do the f o l l o w i n g:

4 a . Ask the u s e r t o e n t e r a p o s i t i v e i n t e ge r ( d i g i t s onl y ) n .

5 b . Check the v al u e e n t e r e d t o s e e i f i t c o r re s p o n d s t o a p o s i t i v e i n t e g e r .

6 c . I f the u s e r e n t e r e d a p o s i t i v e i n t e ge r do the f o l l o w i n g :

7 8 I f 0 < n < 30 c a l c u l a t e 2ˆn then p ri n t nand the c a l c u l a t e d r e s u l t with a s u i t a b l emessage .

9 10 I f 30 < n < 50 c a l c u l a t e 2 ˆ ( 0. 3 ∗ n )then p ri n t n and the c a l c u l a t e d r e s u l t with a s ui t a b l e message .

11 12 I f 50 < n < 80 c a l c u l a t e 1 . 5 ˆ ( 0 . 3 ∗n ) then p ri n t n and the c a l c u l a t e d r e s u l t with as u i t a b l e message . 1

3 14 I f n > 80 c a l c u l a t e 1 . 2 ˆ ( 0 . 2 ∗ n ) thenp ri n t n and the c a l c u l a t e d r e s u l t with a s u i t ab l e message .

15 16 17 d . Otherwise , p ri n t the message You did not e n te r a v a l i d i n p u t ! .

Use python language

Expert Answer


Answer to Write a program , with comments , t o do the f o l l o w i n g : 4 a . Ask the u s e r t o e n t e r a p o s i t i v e i… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *