Questions
Card Shuffling and Dealing (C++) All in one file with comments explaining please! Create a program...

Card Shuffling and Dealing (C++)

All in one file with comments explaining please!

Create a program to shuffle and deal a deck of cards. The program should consist of a class Card, class DeckOfCards and a driver program.

Class Card should provide:

a)      Data members face and suit of type int.
b)      A constructor that receives two ints representing the face and suit and uses them to initialize the data members.
c)      Two static arrays of strings representing the faces and suits.
d)      A toString function that returns the Card as a string in the form "face of suit." You can use the + operator to concatenate strings.

Class DeckOfCards should contain:

a)      An array of Cards named deck to store the Cards.
b)      An integer currentCard representing the next card to deal.
c)      A default constructor that initializes the Cards in the deck.
d)      A shuffle function that shuffles the Cards in the deck. The shuffle algorithm should iterate through the array of Cards. For each Card, randomly select another Card in the deck and swap the two Cards.
e)      A dealCard function that returns the next Card object from the deck.
f)       A moreCards function that returns a bool value indicating whether there are more Cards to deal.

The driver program should create a DeckOfCards object, shuffle the cards, and then deal the 52 cards.

In: Computer Science

please unique answer, no handwriting, for safeAssign Pilgirism submission.API style You have been hired to design...

please unique answer, no handwriting, for safeAssign Pilgirism submission.API style

You have been hired to design a database for prescriptions for RX pharmacies and your first job now is to design an ER model for this database using the following description of that world.

i. patients are identified by their SSN and have other attributes as names, addresses, and ages.

ii. Doctors are identified by their SSN and have other attributes as names, specialty, and years of experience.

iii. Each pharmaceutical company is identified by name and has a phone number.

iv. For each drug, the trade name and formula must be recorded. Each drug is sold by a given pharmaceutical, and the trade name identifies a drug uniquely from among the products of that company. If a pharmaceutical company is deleted, you need not keep track of its products any longer.

v. Each pharmacy sells several drugs and has a price for each. A drug could be sold at several pharmacies, and the price could vary from one pharmacy to another.

vi. Doctors prescribe drugs for patients. A doctor could prescribe one or more drugs for several patients, and a patient could obtain prescriptions from several doctors. Each prescription has a date and a quantity associated with it. You can assume that if a doctor prescribes the same drug for the same patient more than once, only the last such prescriptions needs to be stored.

vii. Pharmaceutical companies have contracts with pharmacies. A pharmaceutical company can have contracts with several pharmacies and a pharmacy can have contracts with several pharmaceutical companies. For each contract, you need to store a start date, an end date and the contract text.

viii. Pharmacies appoint a supervisor for each contract. There must always be a supervisor for each contract.

Hint: Present the conceptual design first, showing (1) all the entities and their attributes, (2) all the relationships and their attributes, (3) all the constraints before drawing your ER.

Specific Requirement /Constraint Type

Requirements and Constraints from the ER diagram

Entities and attributes in ER

(1 Mark)

Relationships and attributes in ER

(0.75 Mark)

Interpretation of each of the constraints represented on the edge labels in ER

(0.75 Mark)

In: Computer Science

You have the following information about Burgundy Basins, a sink manufacturer. Equity shares outstanding 20 million...

You have the following information about Burgundy Basins, a sink manufacturer.

Equity shares outstanding 20 million
Stock price per share $ 46
Yield to maturity on debt 7.5 %
Book value of interest-bearing debt $ 385 million
Coupon interest rate on debt 5.1 %
Market value of debt $ 280 million
Book value of equity $ 480 million
Cost of equity capital 13.2 %
Tax rate 35 %

Burgundy is contemplating what for the company is an average-risk investment costing $52 million and promising an annual ATCF of $5.6 million in perpetuity.

a. What is the internal rate of return on the investment? (Round your answer to 2 decimal places.)

b. What is Burgundy's weighted-average cost of capital? (Round your answer to 2 decimal places.)

In: Finance

For the reaction 2Co3+(aq)+2Cl−(aq)→2Co2+(aq)+Cl2(g). E∘=0.483 V what is the cell potential at 25 ∘C if the...

For the reaction 2Co3+(aq)+2Cl−(aq)→2Co2+(aq)+Cl2(g). E∘=0.483 V what is the cell potential at 25 ∘C if the concentrations are [Co3+]= 0.222 M , [Co2+]= 0.275 M , and [Cl−]= 0.309 M and the pressure of Cl2 is PCl2= 3.80 atm ?

In: Chemistry

From the text Psychology: Modules for Active Learning 1. How does intelligence vary from person to...

From the text Psychology: Modules for Active Learning

1. How does intelligence vary from person to person?

2. What are some controversies in the study of intelligence?

In: Psychology

You have just been offered a 12% bond for $1150. These bonds mature in 6 years....

You have just been offered a 12% bond for $1150. These bonds mature in 6 years. Find the required rate of return.

In: Finance

Explain Ziegler and White’s (1990) findings on racism in use of sources on network news

Explain Ziegler and White’s (1990) findings on racism in use of sources on network news

In: Psychology

Discuss the challenges of implementing Supply Chain Management (SCM) in a healthcare organization and how they...

Discuss the challenges of implementing Supply Chain Management (SCM) in a healthcare organization and how they can overcome these challenges? If you can, provide an example of where you have seen this happen.

In: Operations Management

Problem: Design and write a C language program that can be used as a unit converter...

Problem:

Design and write a C language program that can be used as a unit converter application. Your unit converter should contain at least four unit categories, for example: length, mass, temperature, and time. The program should display the main menu that contains unit categories that are available, and the user will be prompted to select a unit category first. After the unit category has been selected the program should then display another menu (i.e., a submenu) that contains at least three units or more for the chosen unit category. For example, if the mass unit category is selected, the units shown in its submenu could be: kilogram, pound, and ounce. The user will be prompted next to enter a value (i.e., a floating point number) to be converted, as well as the two units from the submenu. The first unit is the unit to be converted, while the second unit is the unit to which the first unit will be converted. After these two units are selected, the program will compute and display the result of the conversion. The program will then prompt the user to return to the main menu and repeat the same process, or terminate the program. Program requirements: It is required to use the following C language constructs: · User-Defined Functions . switch/case · Loops · Decisions

In: Computer Science

Using Java Summary Create a Loan class, instantiate and write several Loan objects to a file,...

Using Java

Summary

Create a Loan class, instantiate and write several Loan objects to a file, read them back in, and format a report.

Project Description

You’ll read and write files containing objects of the Loan class. Here are the details of that class:

Instance Variables: customer name (String)
annual interest percentage (double)
number of years (int)
loan amount (double)
loan date (String)
monthly payment (double)
total payments (double)

Methods:

  • getters for all instance variables
  • setters for all instance variables except monthly payment and total payment
  • calculateMonthlyPayment and calculateTotalPayments

The setters for the annual interest percentage, number of years, and loan amount invoke both “calculate…” methods before they exit

The “calculate…” methods compute the named value, then store that amount in the associated instance variable. They are private (helper) methods.

Constructors:

  • a “no-arg” constructor sets the customer name to a default value, the loan date to “no date”, and all numeric variables to zero. This method invokes the “full” constructor
  • a “full” constructor takes the customer name, annual interest percentage, number of years, loan amount, and loan date. It invokes the appropriate setters, but doesn’t need to invoke the “calculate” methods (why?)

Calculations:

monthly interest rate = annual interest percentage / 1200

monthly payment = (loan amount * monthly interest rate) /
(1 – Math.pow( (1 + monthly interest rate), – (number of years * 12) ) )

total loan payments = monthly payment * number of years * 12

* Note: Round all dollar amounts to 2 decimal places

Here is what you should do in main

Use this data to create five Loan objects

                Annual Interest           Loan
  Customer Name   Percentage    Years    Amount   Loan Date
  Bob Smith             6.5%       30   318,000   Sep 1, 2015
  Alicia Herman         4.2%       15   248,000   Oct 15, 2013
  Julie Franciosa       8.5%       10    30,000   Apr 14, 2010
  Julio Quiros         15.0%        3    50,000   June 23, 2017  
  Frank Larsen          8.9%        5    23,000   Mar 8, 2016

Use this algorithm:

  1. Make the Loan class Serializable (don't forget to import this interface from java.io).
  2. Instantiate Loan objects representing the first three loans above using the “full” constructor
  3. Create an output stream and store the three objects into a binary file using the writeObject method
  4. Instantiate Loan objects representing the last two loans above using the “no-arg” constructor, then use setters to update information about those loans
  5. Append those objects to the output stream created above in step 2
  6. Close the output stream
  7. Create an input stream and read the objects from the binary file above and display in a nicely formatted columnar report
  • Write your code to handle any number of loan objects (i.e., do not assume that there are 5 Loan objects in the file -- use a loop).
  • Include in your report the monthly loan payment and total loan payment amounts
  • Display totals for the amount of the loan amounts, monthly payments, and total loan payments.
  1. Close the input stream

Note: After writing the first three Loan objects to a file (in step 2), close the output stream, then re-open the output stream before step 4 appending the last two Loan objects to the existing file

An example of the output from your program

                    Annual                    Monthly       Total 
    Customer Name   Prcnt  Yrs  Loan-Amount   Payment   Loan Payments   Loan-Date
  ----------------  -----  ---  -----------  ---------  ------------  -------------  
  Bob Smith           6.5   30   318,000.00   2,009.98    723,592.80  Sep 1, 2015
  Alicia Herman       4.2   15   248,000.00   1,859.38    334,688.40  Oct 15, 2013
  Julie Franciosa     8.5   10    30,000.00     446.35     53,562.00  Apr 14, 2010
  Julio Quiros       15.0    3    50,000.00   1,660.72     59,785.92  June 23, 2017
  Frank Larsen        8.9    5    23,000.00     476.33     28.579.80  Mar 8, 2016
                                ===========  =========  ============
                                 669,000.00   6,452.76  1,200,208.92  

In: Computer Science

Determine the representation for the following decimal numbers in single-precision IEEE 754 format. Give them in...

Determine the representation for the following decimal numbers in single-precision IEEE 754 format. Give them in 32-bit binary and show the calculation.

-10^(−8)

In: Computer Science

should people who are drug addicts receive withdrawal treatment ?

should people who are drug addicts receive withdrawal treatment ?

In: Nursing

Draw a flowchart that will calculate the roots of a quadratic equation. (java) Can someone draw...

Draw a flowchart that will calculate the roots of a quadratic equation. (java)

Can someone draw it for me? and at same time explain,

In: Computer Science

a.) Evaluate the costs and benefits arising from the creation of NAFTA to the Mexican economy?...

a.) Evaluate the costs and benefits arising from the creation of NAFTA to the Mexican economy?

b.) Does NAFTA strengthen or weaken the world trading system?

In: Economics

Because children in the preschool years are becoming more psychologically aware of themselves and others, how...

  1. Because children in the preschool years are becoming more psychologically aware of themselves and others, how does this mis-perception between "niceness" and "authority" makes them at-risk for others to take advantage of them.
  2. b) Explain why you think their socioemotional development and their cognitive development (Chapter 5) are tied together.

2) Moral and emotional development are tied to several factors in development. Emotional regulation and social competence are 2 of these factors. "... researchers consider the growth of emotional regulation in children as fundamental to the development of social competence."



a). In your own words, define Emotional Regulation AND DISCUSS why this is an important developmental piece to succeeding in social relationships.


b). In your own words, define Social Competence AND DISCUSS why this is an importance piece to succeeding in kindergarten, first grade, sports, and with peers.


c). In your own words, define Moral Reasoning AND DISCUSS the importance of and HOW parents can "emotionally coach" their children.


In: Psychology