Question

In: Computer Science

Need it in C# using visual studio (also can you show me how to implement the...

Need it in C# using visual studio (also can you show me how to implement the code in vs)

Create a New Project named Preferred Customer to be used in a retail store for preferred customers, where customers can earn discount on all purchases depending upon how much money they are going to spend. To begin with designing your Application, you must add a class named Person with properties for holding a Person’s Name, Address and Telephone Number. Next step is to create a class named Customer, which is derived from the Person class. The Customer class must have a property for Customer Number and a Boolean property indicating whether customer wished to be on a mailing list. Further, design a class named PreferredCustomer, which is derived from the Customer class. The PreferredCustomer Class must have properties for an amount of the customer’s purchases and the customer’s % discount earned. The GUI of Application (Form1 object) must have four input Text Boxes: (1) one for customer’s Full Name, (2) the second for customer’s Full Address, (3) the third one for customer’s Phone Number and (4) the fourth one for customer’s Purchased Amount as shown in Fig. 1. BorderStyle property of the Purchased Amount text box control is to be set at Fixed3D. In addition to these four Text Boxes, your Application must have one Radio button and one Display button controls: (1) Radio button is used to add customer’s name in mailing list or not, and (2) Display button, when clicked demonstrates the class in this Application. When you click Display button without entering any real data in tis GUI, the Application must show a message in a Message Box that “Input string was not in a correct format”, which is shown in Figure 2 on page # 2. Then you click OK button to enter real data input in Application’s GUI. Your Application must have provision of Close and Clear buttons in its interface so that it could be possible to close it and clear all controls in its GUI. It is required that your GUI should be displayed at the Center of your computer’s monitor and your source code must have Comment Lines at appropriate places. Take a screen-shot of your GUI for each run, copy and paste it in a MS Word doc file.

Solutions

Expert Solution

OUTPUT-

CODE-

using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace PreferredCustomer
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
PreferredCustomer customer = new PreferredCustomer();
customer.name = textBox1.Text;
customer.address = richTextBox1.Text;
customer.contact = textBox2.Text;
customer.amountPurchased = Convert.ToDouble(textBox3.Text);
if(radioButton1.Checked==true)
{
customer.mailingList = false;
}
else
{
customer.mailingList = true;
}

if (customer.amountPurchased == 500)
customer.discount = "5%";

if (customer.amountPurchased == 1000)
customer.discount = "6%";

if(customer.amountPurchased==1500)
customer.discount="7%";

if (customer.amountPurchased == 2000)
customer.discount = "10%";


MessageBox.Show("Name: " + customer.name + "\n" + "Address: " + customer.address + "\n" + "Phone: " + customer.contact + "\n" + "Amount purchased: " + customer.amountPurchased + "Future discount value is " + customer.discount);


}
}

public class PreferredCustomer{

public string name;
public string contact;
public string address;
public bool mailingList=true;
public double amountPurchased;
public string discount;

}


}


Related Solutions

C++ PROGRAM Using the attached C++ code (Visual Studio project), 1) implement a CoffeeMakerFactory class that...
C++ PROGRAM Using the attached C++ code (Visual Studio project), 1) implement a CoffeeMakerFactory class that prompts the user to select a type of coffee she likes and 2) returns the object of what she selected to the console. #include "stdafx.h" #include <iostream> using namespace std; // Product from which the concrete products will inherit from class Coffee { protected:    char _type[15]; public:    Coffee()    {    }    char *getType()    {        return _type;   ...
Programming Language: C# CheckingAccount class You will implement the CheckingAccount Class in Visual Studio. This is...
Programming Language: C# CheckingAccount class You will implement the CheckingAccount Class in Visual Studio. This is a sub class is derived from the Account class and implements the ITransaction interface. There are two class variables i.e. variables that are shared but all the objects of this class. A short description of the class members is given below: CheckingAccount Class Fields $- COST_PER_TRANSACTION = 0.05 : double $- INTEREST_RATE = 0.005 : double - hasOverdraft: bool Methods + «Constructor» CheckingAccount(balance =...
Create a C++ project in visual studio. You can use the C++ project that I uploaded...
Create a C++ project in visual studio. You can use the C++ project that I uploaded to complete this project. 1. Write a function that will accept two integer matrices A and B by reference parameters, and two integers i and j as a value parameter. The function will return an integer m, which is the (i,j)-th coefficient of matrix denoted by A*B (multiplication of A and B). For example, if M = A*B, the function will return m, which...
Can you show me a UML example for the game mastermind. Using C++
Can you show me a UML example for the game mastermind. Using C++
Develop a C++/Python program using visual studio connected to mysql workbench to show all vendor's name...
Develop a C++/Python program using visual studio connected to mysql workbench to show all vendor's name and phone (vendor_name and vendor_phone) in the state "CA" and the city "Los Angeles". here is the database tables CREATE TABLE general_ledger_accounts ( account_number INT PRIMARY KEY, account_description VARCHAR(50) UNIQUE ); CREATE TABLE terms ( terms_id INT PRIMARY KEY AUTO_INCREMENT, terms_description VARCHAR(50) NOT NULL, terms_due_days INT NOT NULL ); CREATE TABLE vendors ( vendor_id INT PRIMARY KEY AUTO_INCREMENT, vendor_name VARCHAR(50) NOT NULL UNIQUE, vendor_address1...
ONLY USE VISUAL STUDIO (NO JAVA CODING) VISUAL STUDIO -> C# -> CONSOLE APPLICATION In this...
ONLY USE VISUAL STUDIO (NO JAVA CODING) VISUAL STUDIO -> C# -> CONSOLE APPLICATION In this part of the assignment, you are required to create a C# Console Application project. The project name should be A3<FirstName><LastName>P2. For example, a student with first name John and Last name Smith would name the project A1JohnSmithP2. Write a C# (console) program to calculate the number of shipping labels that can be printed on a sheet of paper. This program will use a menu...
answer the following using C# Design and program a Visual Studio Console project in C# that...
answer the following using C# Design and program a Visual Studio Console project in C# that allows your user to enter a number. The program will examine the number to see if it is prime. If it is prime, it will print the next higher prime and the next lower primes to the console. If the number entered by the user is not prime, display a message to that effect. All code should be written by you. Do not copy/paste...
Using C# visual basics Can someone show a calculator with a button that does a FOR...
Using C# visual basics Can someone show a calculator with a button that does a FOR LOOP about 10x time and does a print out of a name 10x
C# ( asp.net ) 2019 Visual Studio I have a dropdown where you can select (...
C# ( asp.net ) 2019 Visual Studio I have a dropdown where you can select ( integer, string, date ) After selecting the desired dropdown option, user can input a list of inputs. For example; for integer: 2,5,7,9,1,3,4 And then , I have a 'sort' button Can you please help me with the code behind for sorting them( For integer, string, and date ) Thank you.
USING VISUAL STUDIO 2017, LANGUAGE VISUAL C# I have struggled on this program for quite some...
USING VISUAL STUDIO 2017, LANGUAGE VISUAL C# I have struggled on this program for quite some time and still can't quite figure it out. I'm creating an app that has 2 textboxes, 1 for inputting customer name, and the second for entering the number of tickets the customer wants to purchase. There are 3 listboxes, the first with the days of the week, the second with 4 different theaters, and the third listbox is to display the customer name, number...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT