Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Task 3: Check whether shopper is new or existing customer (3 Marks) a) Request a

ID: 3915535 • Letter: T

Question

Task 3: Check whether shopper is new or existing customer (3 Marks) a) Request and store this information from the shopper. This information will affect the validity of the promotional code entered Enter 0 for new customer Enter 1 for existing customer Enter status : 0 You are a new customer. welcome to Zazada online shopping Mall! Enter 0 for new customer Enter 1 for existing customer nter status : 1. You are an existing customer. Welcome back! Task 4: Check if shopper has a promotional code. Allow the shopper to key in a promotion code and display entry in uppercase (5 Marks) a) If shopper does not have a promotional code, the program should not ask for promotional code. Do you have a promotional code (Y/N)? n b) If shopper has a promotional code, allow the shopper to enter the promotional code either in uppercase or lowercase. Entry is not case- sensitive. c) Program should be able to convert entry to uppercase and display the promotional code in uppercase. Do you have a promotional code (Y/N) ? y Enter Promotional codeciti10off Promotional code CITI10OFF applied!

Explanation / Answer

Change the namespace and program name according to your program

3.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Collections;

namespace Rextester
{
public class Program
{
public static void Main(string[] args)
{
int status = 0;
  
Console.WriteLine("Enter 0 for new customer ");
Console.WriteLine("Enter 1 for existing customer ");
Console.WriteLine("Enter Status : ");
string input= Console.ReadLine();

status = Int32.Parse(input);

if(status == 0){
Console.WriteLine(" You are a new customer. Welcome to Zazada online shoping Mall!");

}
else if(status == 1){
Console.WriteLine(" You are an existing customer. Welcome back!");
}
}
}
}

4.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Collections;

namespace Rextester
{
public class Program
{
public static void Main(string[] args)
{
  
  
Console.WriteLine("Do you have a promotional code (Y/N) ? ");
string input= Console.ReadLine();


if(input[0] == 'n' || input[0] == 'N'){
Console.WriteLine(" You are a new customer. Welcome to Zazada online shoping Mall!");

}
else if(input[0] == 'y' || input[0] == 'Y'){
Console.WriteLine("Enter Promotional Code : ");
string code= Console.ReadLine();
string uCode= code.ToUpper();
Console.WriteLine("Promotional Code ",uCode," applied!");
}
}
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote