Choosing how to earn college credit? CLEP vs AP guide
| preferred AP College board partner for AP classes
AP Computer Science Principles/Big Idea 2: Data
Start Practice TestPractice Test
About Exam
hard

Normalizing Transit Payment Data

Mark
< Prev
Next >

A transit system collects payment data from multiple stations. Different stations use different text strings to record when a passenger pays with a mobile app. The raw data contains the following strings for mobile payments: “App”, “Mobile”, “app”, “Smartphone”, and “MOBILE”.

A programmer is writing a script to clean the data so that all mobile payments are recorded as “Mobile_App” before generating a revenue report.

Which of the following describes the most appropriate way to normalize this data without changing its meaning?

A

Replace any string that contains the letter ‘p’ or ‘m’ (case-insensitive) with “Mobile_App”.

B

Delete all records containing “App”, “app”, “Smartphone”, or “MOBILE” and only keep records containing “Mobile”.

C

Check if the string is exactly equal to “App”, “Mobile”, “app”, “Smartphone”, or “MOBILE”, and if so, replace it with “Mobile_App”.

D

Convert all strings in the dataset to uppercase, then replace any string longer than 3 characters with “Mobile_App”.

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Not enough data yet to show leaderboard.

No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Instagram: @_apfive_|Privacy Policy|