Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem Jl: Telemarketer or not? Problem Deseription Here at the Concerned Citizens of Commerce (COCL we have noted that telemarketers like to use seven-digit phone

image text in transcribed
image text in transcribed
Problem Jl: Telemarketer or not? Problem Deseription Here at the Concerned Citizens of Commerce (COCL we have noted that telemarketers like to use seven-digit phone numbers where the last four digits have three properties. Looking just at the last four digits, these properties are the first of these four digits is an 8 or 9 the last digit is an 8 or9 e the second and third digits are the same. For example, if the last four digits of the telephone number are 8229, 8338, or 9008, these are telemarketer numbers. Write a program to decide if a telephone number is a telemarketer number or not, based on the last four digits. If the number is not a telemarketer number, we should ans wer the phone, and otherwise, we should ignore it. Input Specification The input will be 4 lines where each line contains exacdy one digit in the range from 0 to 9 Output Specification Output either ignore if the number matches the pattem for a telemarketer number; otherwise, output answer Sample Input Output for Sample Input 1 ignore Explanation of Output for Sample Input1 The first digit is 9, the last digit is 8, and the second and third digit are both 6, so this is a telemar- keter number. Sample Input 2 Version franaise sont aprs la version anglaise Problem J2: Occupy parking Problem Description You supervise a small parking lot which has N parking spaces Yesterday, you recorded which parking spaces were occupied by cars and which were empty Today, you recorded the same information. How many of the parking spaces were occupied both yesterday and today? Input Specification The first line of input contains the integer NISN 100). The second and third lines of input contain N characters each. The second line of input records the information about yesterday's parking spaces, and the third line of input records the information about today's parking spaces Each of these 2N characters will either be C to indicate an occupied space or to indicate it was an empty parking space. Output Specification Output the number of parking spaces which were occupied yesterday and today. Sample Input 1 Output for Sample Input 1 Explanation of Output for Sample Input 1 Only the second parking space from the left was occupied yesterday and today Sample Input 2 ... Output for Sample Input 2 Explanation of Output for Sample Input The first, third, fifth, and seventh parking spaces were occupied yesterday and today Version franaise sont aprs la version anglaise

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_2

Step: 3

blur-text-image_3

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part 2 Lnai 8725

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448505, 978-3662448502

More Books

Students also viewed these Databases questions

Question

Have I incorporated my research into my outline effectively?

Answered: 1 week ago