Prompt the user for the details of a credit card transaction

Assignment Help Computer Engineering
Reference no: EM132112753

Purpose

To practice UDP programming, including the use of the socket, bind, sendto, and recvfrom system calls.

Assignment

Write a C++ program that will validate (imaginary) credit card transaction information by querying to a UDP server. You will be writing the client, and the server's address and port information will be provided to you.

Program

Implement a C++ program that prompts the user for the details of a credit card transaction. These details include the name of the card holder, the credit card number, the expiration date, and the dollar amount to be authorized. The card holder name is a string. The card number must be a 15 or 16 digit number. The expiration date is of the form MM/YYYY (eg. 12/2019). The amount will be a number with two digits after the decimal point.

Your program will send the information to a UDP server in a single datagram containing all of the information spec- ified. The server will respond with a single datagram, containing whether the credit card transaction is valid, and an authorization code.

The UDP datagram sent to the server must contain the card number, expiration date, amount, and card holder name in a colon separated list, for example: "6011 1234 4321 1234:12/2016:543.21:John Doe".

UDP Server Details

The details for the UDP Server will be listed in the assignment listing on BlackBoard.

Error Checking

Your program must check whether the name, credit card, expiration date, and amount are well formed. If they are not, prompt the user for them again.

Name can be any string less than 64 characters. Credit card number must be either 15 or 16 digits, with the possibil- ity that spaces may be used between numbers to separate them into groups. The expiration date must be of the form MM/YYYY (obviously MM should be between 01 and 12). The amount can be any number digits followed by a decimal point and then two more digits.

 

Reference no: EM132112753

Questions Cloud

Write an expression that evaluates to a new list containing : Write an expression that evaluates to a new list containing all the elements from the one at index k through the one at index.
Write a statement that assigns 15 to the list element : Write a statement that assigns 15 to the list element whose index is k.
Write a program to check whether a string entered palindrome : Write a program to check whether a string entered is a palindrome. A string is a palindrome if it reads the same forward and backwards.
Write a recursive function that accepts a tuple : An 'array palindrome' is an array, which, when its elements are reversed, remains the same.
Prompt the user for the details of a credit card transaction : To practice UDP programming, including the use of the socket, bind, sendto, and recvfrom system calls.
Create a program that can display information : Create a program that can display information about the first ten elements in the periodic table. The periodic table of is a table of the chemical elements.
Compute the projects IRR and NPV : Compute the projects IRR and NPV. In addition, answer the following questions: Do you believe that there was sufficient financial information to make a solid
How many pieces of candy was just sold and what type : A good friend of yours is managing a fund raiser for a football team. He needs a program to calculate the total amount of candy sold at a football game.
Create implementation of priorityarrayqueue : Create implementation of PriorityArrayQueue and PriorityLinkedQueue.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Determining average degree of vertex

For the random geometric graph, G(n, r), determine the average degree of the vertex: At least distance r from the boundary,

  How much of companys network capacity are employee consuming

How much of the company's network capacity are employees consuming when watching YouTube videos? What percentage of available bus cycles on employees' computers are consumed when watching the videos?

  Implement register to resolve war and waw dependences

Now assume that register renaming is implemented to resolve WAR and WAW dependences. Determine the number of clock cycles it takes to execute.

  Describe threats and vulnerabilities of social engineering

Describe the threats and vulnerabilities of social engineering and social media; include how they are similar and how they are different.

  Explain conceptual model of effective computer instruction

Briefly explain the conceptual Model of Effective Computer Based Instruction for Adults, outlining the three Units (Input, Process, and Output).

  Discuss merits of asynchronous and synchronous memory access

The quoted physical address space of the 68000 is 16 Mbytes (i.e., 2 24 bytes). I could maintain that it is 64 Mbytes. What is the argument I might use.

  Define smaller industry-specific software developers

Does Microsoft's entry into industry-specific applications signal the end for smaller industry-specific software developers? What changes in strategy by such developers are necessary to compete with Microsoft.

  What is a data scientist and what does the job involve

What are recommender systems, how are they developed, and how is the data used to build a recommendation system obtained?

  Write a c language program to generate a square wave on pin

Write a C language program to generate a square wave on pin 3 of PORTC with a 4 ms period using Timer3 in 16-bit mode with a prescaler value of 1:8.

  What business to consumer and consumer to business items

Marketing and the owner of the CyberCafe would like to have items both in our shop and in Internet ecommerce site. What Business to Consumer and Consumer to Business items would your team recommend. What are the possibilities for fulfilment?

  Describe the mechanics of Buffer overflows

Prepare a complete tutorial, including an analogy to describe the mechanics and a graphic to support your analogy, on one of the subsequent areas

  Write a program that displays the average grade

Suppose the file Final.txt contains student grades on a final exam. Write a program that displays the average grade on the exam and the percentage of grades that are above average.

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