Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab 3-Credit Card (in class) CSCI 251 Problem Statement Did you know that the first six digits of the credit card number encode the card

image text in transcribed
image text in transcribed
Lab 3-Credit Card (in class) CSCI 251 Problem Statement Did you know that the first six digits of the credit card number encode the card type/issuer. For example Visa credit cards in the US begin with the number 4. Although the mapping is a lr for lab 3, write a program that determines the type of credit for an input account number following list Card Type American Express Discover MasterCard Visa Card Number Prefix 34, 37 Write a program that prompts for the account number. Parse off the first two digits. Using a switch statement determine the type of credit card. Notice that Visa only requires the first digit is 4 so how can you account for the second digit in the switch case statements? Input Data . credit card number, string Output Data .Account number and type of credit card Before You Begin 1. Start MATLAB (Start> All Programs> MATLAB) and change your Current Folder to the location of your hard drive (e.g., K:/MATLAB programs) If you forget to do this, your MATLAB programs will not be accessible whenever the computers in this lab are cleared, which is throughout the semester. 2. In the Command Window, type edit creditCard yourLastName.m MATLAB should prompt that the file does not currently exist, select OK so MATLAB will create the file in your Current Folder. Starting File Include header comments (i.e., at the beginning of your file) formatted as show below. Your electronic submission of the program file will represent your endorsement of the Honor Code Statement % Course: CSCI 251, Section X % Student Name: Jane Doe % Student ID: 12345678 %Lab 3 in class % Due Date: % In keeping with the Honor Code of the School of Engineering, I have neither % given nor received assistance from anyone other than the instructor. % Program Description: Algorithm 1. Begin your program with to clear the Command Window and Workspace windows, respectively Prompt (ask) the user for the credit card number clc clear 2

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

Step: 3

blur-text-image

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

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

More Books

Students also viewed these Databases questions

Question

LO2 Identify components of workflow analysis.

Answered: 1 week ago