INTRODUCTION TO COMPUTER SCIENCE IT
EXAM I – if – switch – loops
Exercise 1. (If)
The price of one cinema ticket is:
7 Euro when you buy only 1 ticket
6 Euro when you buy from 2 to 3 tickets
5 Euro when you buy from 4 to 6 tickets
4 Euro when you buy more than 6 tickets
Write a program that takes from user the number of cinema tickets he wants to buy, and then calculates and displays the total cost of buying them according to the prices above.
When user enters an incorrect number of tickets, the program should display „The number of tickets cannot be negative”.
Exercise 2. (Switch)
Write a program that allows the user to enter a month number (we expect number between 1 and 12) and then displays how many days are in the corresponding month (e.g. if the user enters 3 the program should display
„March consists of 31 days”). Notice that if the user inputs 2 the program should display
„February consists of 28 days in a common year and 29 days in a leap year”. If the user enters a number that isn't in the range from 1 to 12, it prints the message "The number does not represents any month of a year".
Exercise 3. (Loops)
Write a program that keeps taking in integers from user until a negative integer is given to stop. Then take all the positive integers that have been entered and get the average of them all.
Exercise 4. (Loops)
Write a program that displays a multiplication table size n x n (take n from user).
really quickly
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme