Program that asks the user for the month and a positive n

Assignment Help Basic Computer Science
Reference no: EM131048746

Write a program that asks the user for the month (April, May, or June) and a positive integer n. Your program should then print two types of results. The first should report the title of the first movie that has first been rented (scanned) n times in that month. For example, the following is an actual example using this data. The output is correct in this example, so you can use it as one test of your results:
Please enter the month by typing April, May, or June: April
Please enter a positive integer: 3
The first movie rented 3 times in April was On The Waterfront (1954).
The second part of your output should contain a listing of all movies that were rented exactly n times during the entire month. For example, the following output is also correct, based on april.txt:
There were 16 movies rented exactly 3 times in April:
ID Title
-- ---------------------------------------
5 Lawrence of Arabia (1962)
12 Sunset Boulevard (1950)
14 Some Like it Hot (1959)
15 Star Wars (1977)
26 Dr. Strangelove (1964)
27 Bonnie and Clyde (1967)
33 High Noon (1952)
35 It Happened One Night (1934)
45 A Streetcar Named Desire (1951)
49 Snow White and the Seven Dwarfs (1937)
51 The Philadelphia Story (1940)
60 Raiders of the Lost Ark (1981)
68 An American in Paris (1951)
74 The Gold Rush (1925)
92 A Place in the Sun (1951)
99 Guess Who's Coming to Dinner (1967)
Your output should look exactly like this, including the sentence before the table, the header, and the order of the IDs and Titles in the table (i.e., in ascending order according to ID number). You will need to read at least parts of both files (the month, and the catalog) to accomplish this. You should think carefully about how to keep track of totals for each title in an array. If there is a tie for most or least times, your program should print out the movie with the lowest id. Hand in output of testing this for April, May, and June, in that order.

Reference no: EM131048746

Questions Cloud

Improve organizational performance : How do enterprise applications, collaboration and communication systems, and intranets improve organizational performance? Give examples to illustrate your answer.
A tropical rain forest affect the forest : Logging in the rain forest: contrasts. Figure 29.2 (page 29-5) gives basic ANOVA output for the study of the effects of logging described in Example 29.1. We might describe the overall effect of logging by comparing the mean species count for unlo..
Program using a loop that multiplies two non-negative number : Write code to implement the expression: A= (B + C) * (D - E) on 3-, 2-, 1- and 0-address machines. In accordance with programming language practice, computing the expression should not change the values of its operands.
Analyse house prices against all other variables : Analyse house prices against all other variables included in the dataset. Use appropriate descriptive techniques such as cross-tabulations, comparative summary measures, scatter diagrams to identify key relationships
Program that asks the user for the month and a positive n : Write a program that asks the user for the month (April, May, or June) and a positive integer n. Your program should then print two types of results. The first should report the title of the first movie that has first been rented (scanned) n times..
Learn test through short logical assessment : James and Jennifer Stolpa and their five-month old kid, Clayton, were stranded outside in a snowstorm for right around 8 days. These types of individuals were spared after James left Jennifer and Clayton in a natural hollow and climbed 31 mills in..
Accused of using non-job-related criteria : Many employers are accused of using non-job-related criteria in hiring decisions. The best management practice for an employer to use in refuting this type of allegation would mos likely be:
Steady supply in the company : Assume you are the CEO of one of the biggest companies in the united states such as Philips, how will you ensure a steady supply in the company?
Analyse trends and issues in creating learning organisation : Purpose: To allow students to demonstrate their ability to research, critically analyse trends and issues in creating and managing a learning organisation in Australia today. The assessment also allows students to further develop their team wor..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  What are the three fundamental analysis strategies?

What are the three fundamental analysis strategies? Compare and contrast the outcomes of each strategy.

  Find a simplified expression for function

find a simplified expression for F = A?BC?D + A?B?D + A?CD + ABD + ABC - Assuming that the inputs ABCD = 0101, BCD = 1001, ABCD = 1011 never occur,

  Illustrate the economic concepts of scarcity

2.Use the graph to illustrate the economic concepts of scarcity, unemployment, inefficiency, and opportunity costs. When possible, use data points on the graph to accompany your verbal explanation.

  Write a sql query to display last

Write a SQL query to display Last, First, Gender, Entryyear, State and MajorID for all students whoeither have an entryyear in 2010 or are from Kentucky, and where the student is either Male ormajoring in MIS. Name the query SQL_09_LuckyStudents.

  Write a program keeps an appointment calendar in database

Write a program that keeps an appointment calendar in a database.

  Prompts the user for a hexadecimal digit

Write a MIPS program that prompts the user for a hexadecimal digit and then displays the decimal equivalent multiplied by 2. For example, the program displays 10 for hex '5', 20 for 'A', etc. If the user enters an invalid value, the program should di..

  Round-robin scheduling is used to execute the processes

a) If round-robin scheduling is used to execute the processes, how many items will each process have produced and consumed at the end of 10 time quanta? Assume that the initial run queue order is P1, P2, P3, C1.

  Explain kind of system real-time statistics

Permits customers to see real-time statistics like views and click-throughs about their current banner ads. Which kind of system will most efficiently give a solution.

  Difference between twitter and instant messaging

Question 1: What is the difference between Twitter and Instant Messaging? Question 2: List and briefly discuss three

  What properties are needed in a secure hash function h

What properties are needed in a secure hash function H?

  Information structures

In information structures, an organizing mechanism used to find information in a large collection; in programming, the number that together with an identifier forms an array reference

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd