logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Jeremiah BennetttEconomics
(5/5)

555 Answers

Hire Me
expert
Sina AntiqueePsychology
(5/5)

641 Answers

Hire Me
expert
SayanAccounting
(5/5)

972 Answers

Hire Me
expert
Sarita VashisthEconomics
(5/5)

730 Answers

Hire Me
C++ Programming

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.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

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

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

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

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme