using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleAdvancedTopics { public class CreditCardProcessorTuple { // Tuples in Chapter 8 public (string CardNumber, string ExpDate, string CVC, string ZipCode) GetCreditCardInfo() { Console.WriteLine("Enter Credit Card Number: "); string cardNumber = Console.ReadLine(); Console.WriteLine("Enter Credit Card ExpDate: "); string expDate = Console.ReadLine(); Console.WriteLine("Enter Credit Card CVC: "); string cvc = Console.ReadLine(); Console.WriteLine("Enter Credit Card Zip Code: "); string zipCode = Console.ReadLine(); // return object as tuple return (cardNumber, expDate, cvc, zipCode); // immutable } // tuple object // Display CC Info using object.property public void DisplayCreditCardInfo((string CardNumber, string ExpDate, string CVC, string ZipCode) cardInfo) { Console.WriteLine("\nCredit Card Information"); Console.WriteLine($"Card Number: {cardInfo.CardNumber}"); Console.WriteLine($"Exp Date: {cardInfo.ExpDate}"); Console.WriteLine($"CVC Code: {cardInfo.CVC}"); Console.WriteLine($"Zip Code: {cardInfo.ZipCode}"); } // DisplayCreditCardInfo } }