Questions
Using Visual Studio, C# Programming Lecture: Objects, Inheritance and abstract classes, member init list, shape, circle...

Using Visual Studio, C# Programming

Lecture: Objects, Inheritance and abstract classes, member init list, shape, circle and cylinder.

Complete Exercises 4 and 5 (100pts)

4. Person and customer classes

Design a class named Person with properties for holding a person's name, address, and telephone number. Next, design a class named Customer, which is derived form the Person class. The Customer class should have a property for a customer number and a Boolean property indicating whether the customer wishes to be on a mailing list, Demonstrate an object of the Customer class in a simple application.

5. PreferredCustomer Class

A retail store has a preferred customer plan where customers can earn discounts on all their purchases. The amount of a customers discount is determined by the amount of the customers cummulative purchases in the store as follows:

- When a preferred customer spends $500, he or she gets a 5 percent discount on all future purchases.

- When a preferred customer spends $1,000, he or she gets a 6 percent discount on all future purchases.

- When a preferred customer spends $1,500, he or she gets a 7 percent discount on all future purchases.

- When a preferred customer spends $2,000, he or she gets a 10 percent discount on all future purchases.

Design a class named PreferredCustomer, which is derived from the Customer class you created in Exercise 4. The PreferredCustomer class should have properties for the amount of the customer's purchases and the customer's discount level. Demonstrate the class in a simple application.

Complete below for 100pts extra credit

  • Use overloaded constructors and member initialization list
  • Person will be an abstract class with a virtual function called CalcDiscount
  • Override the discount method for a normal customer and for a preferred customer
    • A normal customer gets a 0% discount review #5 for a preferred customer
  • Create one array of the defined Person object where you instantiate Customers and Preferred Customers in the array
  • Implement and test your override of the discount method
  • Remember your array must be of the Person type

Person[] people=new Person[2];

people[0]=new Customer(arguments here);

people[1]=new Preferredcustomer(arguments here);

people[0].calcdiscount();

people[1].calcdiscount();

use overridden methods to effect polymorphism. overload operators to
enable them to manipulate
objects.
determine an object’s type
at execution time.
create sealed methods
and classes.
create abstract classes and
methods.

In: Computer Science

I am working on a currency exchanging vending machine. I got it to work until the...

I am working on a currency exchanging vending machine. I got it to work until the currency exchange section but the money won't be put into userAmount for the final section and it just repeat the currency exchange section.

Here is my code:

#include <cctype>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <iomanip>

using namespace std;

double convert(double currency, double conversionRate)
{
   return currency * conversionRate;
}

int menu() {
   char choice;
   int price;
   cout << "Welcome to the snack vending machine" << endl;
   cout << endl;
   cout << "Available snacks to select from:" << endl;
   cout << "\t L - Lays Chips \t $2" << endl;
   cout << "\t S - Snickers \t $5" << endl;
   cout << "\t P - PopTart \t \t $3" << endl;
   cout << "\t C - Cookies \t \t $5" << endl;
   cout << "\t B - Browine \t \t $2" << endl;
   cout << "\t N - Nuts \t \t $5" << endl;
   while (1) {
       cout << "Please enter the letter labeling your snack selection: ";
       cin >> choice;
       choice = toupper(choice);
       if (choice == 'L') {
           price = 2;
           break;
       }
       else if (choice == 'S') {
           price = 5;
           break;
       }
       else if (choice == 'P') {
           price = 3;
           break;
       }
       else if (choice == 'C') {
           price = 5;
           break;
       }
       else if (choice == 'B') {
           price = 2;
           break;
       }
       else if (choice == 'N') {
           price = 5;
           break;
       }
       else
           cout << "Invalid selection!" << endl << endl;
   }
   return price;
}

int acceptMoney(int price) {
   int userAmount = 0;
   int choice;
   double currency1, currency2;
   do
   {
       cout << " CURRENCY CONVERSION" << endl << endl;
       cout << "1. Euros to Dollars" << endl;
       cout << "2. Peso to Dollars" << endl;
       cout << "3. Pounds to Dollars" << endl;
       cout << "4. Exit" << endl << endl;
       cout << "Select your choice: ";
       cin >> choice;
       while (choice < 0 || choice > 4)
       {
           cout << "Enter a valid option: ";
           cin >> choice;
       }
       cout << endl;
       switch (choice)
       {
       case 1: cout << "Enter amount in Euros: ";
           cin >> currency1;
           currency2 = convert(currency1, 1.11);
           cout << "Amount in Dollars: " << currency2;
           userAmount += currency2;
           break;

       case 2: cout << "Enter amount in Peso: ";
           cin >> currency1;
           currency2 = convert(currency1, 0.052);
           cout << "Amount in Dollars: " << currency2;
           userAmount += currency2;
           break;

       case 3: cout << "Enter amount in Pounds: ";
           cin >> currency1;
           currency2 = convert(currency1, 1.31);
           cout << "Amount in Dollars: " << currency2;
           userAmount += currency2;
           break;

       case 4: break;
       }
       cout << endl << endl;
   } while (choice != 4);
   return price;
}

int computeChange(int totalPaid, int totalPrice) {
   return totalPaid - totalPrice;
}

int main()
{
   int totalPrice, totalPaid, change;
   char choice;
   while (1) {
       totalPrice = menu();
       totalPaid = acceptMoney(totalPrice);
       change = computeChange(totalPaid, totalPrice);
       cout << endl;
       cout << "Your total inserted: " << totalPaid << " Dollars" << endl;
       cout << "Dispensing change: " << change << " Dollars" << endl;
       cout << endl;
       cout << "Would you want to make another purchase? (Y/N): ";
       cin >> choice;
       cout << endl;
       choice = toupper(choice);
       if (choice == 'N') {
           cout << "Thank you!!!" << endl;
           break;
       }
       cout << endl;
   }
   return 0;
}

In: Computer Science

when is it more appropriate to use online storage as compared to offline storage

when is it more appropriate to use online storage as compared to offline storage

In: Computer Science

Prepare a list of five Web sites that job seekers should visit for advice about cover...

Prepare a list of five Web sites that job seekers should visit for advice about cover letters and résumés, including online postings. Include a one-paragraph summary of the material found on each site.

In: Computer Science

Write a C++ program to enter the grade of 20 students from the keyboard and store...

Write a C++ program to enter the grade of 20 students from the keyboard and store the grades in an array called degree. Use function to find the total number of failed students only. Where the total grade is out of 100.

In: Computer Science

def compare_elevations_within_row(elevation_map: List[List[int]], map_row: int, level: int) -> List[int]: """Return a new list containing the three...

def compare_elevations_within_row(elevation_map: List[List[int]], map_row: int, level: int) -> List[int]:
"""Return a new list containing the three counts: the number of
elevations from row number map_row of elevation map elevation_map
that are less than, equal to, and greater than elevation level.

Precondition: elevation_map is a valid elevation map.
0 <= map_row < len(elevation_map).

>>> compare_elevations_within_row(THREE_BY_THREE, 1, 5)
[1, 1, 1]
>>> compare_elevations_within_row(FOUR_BY_FOUR, 1, 2)
[0, 1, 3]

"""
for i in elevation_map[map_row]:
differences=[0,0,0]
if i<level:
differences[0] += 1
elif i==level:
differences[1] += 1
else:
differences[2] += 1
return differences

This was written in python, I am wondering why does the header of the function shows syntax error starting from List. (List[List[int]], map_row: int, level: int) -> List[int]:)these are all underedline

In: Computer Science

1-) Please submit the solution of your final as Ms-word or PDF document 2-) Complete THREE...



1-) Please submit the solution of your final as Ms-word or PDF document

2-) Complete THREE QUESTIONS out of the four exam questions below.

3-) FOR EACH QUESTION, IT IS REQUIRED to include Ms-Word or Pdf file contains the following

A. Source file and sample of your output screen shots.

B. Up to one page of your program discussion. In the discussion, state the issues that you may have problem with if there is any. Why your program is not running (if it is not)? What was your approach (Your process to the solution)? How did you overcome the issues while writing the program?

C. Write your conclusion as what you have learned from this program.

Not including this report will result of losing 30% because I would not know if you really the one who did it or not.

YOUR REPORT WILL VERIFY THE UNDERSTANDING OF YOUR WORK, AND THAT YOU REALLY DID IT.


Question One: Write an assembly language program that allows a user to enter any 5 numbers then display the sum of the entered 5 numbers.

For example:

Enter: 1, 2, 3, 4, 5

Output First Line: Display: Sum of the Entered is: 15

Output Second Line: Display: Division of entered digit number 4 by entered digit number two 2 so (4/( 2 = 2)

Question Two: Write an assembly language program that allows a user to enter any 6 numbers in any order then display the largest and smallest entered number and the order from small to large and then large to small

For example

Enter: 4, , 2, 7, 9, 6, 1

Display:

Largest entered number is: 9

Smallest entered number is: 1

Large to Small: 9, 7, 6, 4, 2, 1

Small to Large: 1, 2, 4, 6, 7, 9


Question Three: Write an assembly language program to count number of vowels in any given string.

Question Four: Write a procedure named Get_frequencies that constructs a character frequency table. Input to the procedure should be a pointer to a string, and a pointer to an array of 256 doublewords. Each array position is indexed by its corresponding ASCII code. When the procedure returns, each entry in the array contains a count of how many times that character occurred in the string. Include the source code only.

In: Computer Science

Using the following schema, write a SQL query to satisfy the question: What are the names...

Using the following schema, write a SQL query to satisfy the question: What are the names of the suppliers of 'Pith_helmet' sold in a department managed by 'Andrew'?

Schema:

Sale (saleno, saleqty, itemno, dname)

Supplier (splno, splname)

Item (itemno, itemname, itemtype, itemcolor)

Department (deptname, deptfloor, deptphone, empno)

Delivery (delno, delqty, itemnum, dptname, splno)

Employee (empno, empfname, empsalary, departname, bossno)

In: Computer Science

Question 2: Create a class Fract fraction with two private integer data members: num (Numerator) and...

Question 2: Create a class Fract fraction with two private integer data members: num (Numerator) and den (denominator). write code for:

Part A) class declaration header file

Part b) constructor that validates input (prevent 0 on the denominator in a fraction simplified fraction that is not reduced, avoids negative denominators) with default arguments 0 and 1.

Part c)Two fractions with prototype Fract add (fract) and Fract multiply (fract) completing the usual addition and multiplication

Part d) Just all fractions by writing a short test driver that creates two fractions with the values 3/6 and ⅔ and prints there sum and product

C++ language

In: Computer Science

IN C++ PLEASE Given a Student class, create a class with following characteristics The class name...

IN C++ PLEASE

Given a Student class, create a class with following characteristics

  • The class name should be ClassRoom.
  • Private variable students to maintain the list of Student objects.
  • Function addStudent with input parameter name (string) and rollNo(int) adds a new student in “students” list.
  • Method getAllStudents should return all the students in ClassRoom.


Input
    Jack

1

    Jones

    2

    Marry

    3

    where,

  • First & Second line represent a student’s name and roll number. And so on.

Output

    1 - Jack

    2 - Jones

    3 - Marry

Assume that,

  • Maximum “students” count can be 10.

Given Code:

#include<iostream>
#include<cstring>
#include <algorithm>
using namespace std;

class Student{
public:
string name;
int rollNo;
};

   //write your code here

int main()
{
string name;
char temp[20];
int rollNo, N, i;
Student * students;
ClassRoom classRoom;
i=0;
while(getline(cin, name) && cin.getline(temp,20)){
rollNo = atoi(temp);
classRoom.addStudent(name, rollNo);
i++;
}
N = i;
students = classRoom.getAllStudents();
for(int i=0 ; i < N; i++){
cout << (students+i)->rollNo << " - " << (students+i)->name;
if(i<N-1)
cout<<endl;
}
return 0;
}

In: Computer Science

Write a function in Matlab that will compute the approximation for ln(x) given the inputs to...

Write a function in Matlab that will compute the approximation for ln(x) given the inputs to the function are x and n. This function requires a running sum using a for-loop. ln (?) = lim?→∞∑ (−1)^(?−1)*(? − 1)^?/k

In: Computer Science

The purpose of this exercise is to provide the Marketing department with a method to sort...

The purpose of this exercise is to provide the Marketing department with a method to sort a predefined data list by zip code, last name, first name so they can take advantage of bulk mailing rates.   
Assignment: 1. Create a table with the following fields called "Homework1Data" with (4 fields), then run the inserts below into the table (Figure 1-1). 2. Write a single SQL Query that has the following fields (6 fields so they can easily be moved around using a Mail Merge) using these names (alias); Firstname, Lastname, Address, City, State, Zip be sure to sort by zip code, last name, first name 3. Turn in a copy of your SQL Query (single statement - not a procedure)
Hint: The magic exist in the string manipulation functions (LENGTH, INSTR, SUBSTR, etc.)
Figure 1-1:

CREATE TABLE homework1data ( name VARCHAR2(30), address VARCHAR2(30), location VARCHAR2(30), zip VARCHAR2(10)); ----------------------------------------- INSERT INTO Homework1Data (Name, Address, Location, Zip) VALUES ('Ferguson, Shawn M.', '1940 Fountainview Court', 'Reynoldsburg, Ohio', '43068'); INSERT INTO Homework1Data (Name, Address, Location, Zip) VALUES ('Phillips, George', '19 Pleasant St.', 'Columbus, OH', '43231'); INSERT INTO Homework1Data (Name, Address, Location, Zip) VALUES ('Thompson, Mary', '200 E. Main St.', 'Columbus, Oh', '43215'); INSERT INTO Homework1Data (Name, Address, Location, Zip) VALUES ('Swatson, Robert', '584 Yellowstone Dr.', 'Westerville, OH', '43081'); INSERT INTO Homework1Data (Name, Address, Location, Zip) VALUES ('Banks, Heather T.', '19 Pleasant St.', 'Columbus, Ohio', '43231');

In: Computer Science

Amazon and Google have implemented cloud-based DBMS, what are some pros and cons? What are some...

  • Amazon and Google have implemented cloud-based DBMS, what are some pros and cons?
  • What are some of the steps that you can take to assist with cloud DBMS security for an organization?
  • Why is data security important now more than ever?
  • What are some of the steps that we can take to ensure that our database is protected and secure?
  • How can you use user views to enhance security and restrict access?

In: Computer Science

im learning how to code and i hear what is important are data structures and algorithms....

im learning how to code and i hear what is important are data structures and algorithms. i hear its always important to know my data structures and algorithms. i wpuld like a list of all of them or maybe just the most important ones. This is to have an idea.

In: Computer Science

What is the circuit diagram of password based door lock system project by using interface 8088...

What is the circuit diagram of password based door lock system project by using interface 8088 microprocessor with peripherals Ics ( PPI , PIT and PIC ) and what is code by using assembly language ?

notes:
1- this question related to microprocessor Interface subject .
2- I need answer after 4 hour very necessary , please

In: Computer Science