Part A:
Rainbow City had the following transactions during the year.
Required: Prepare the necessary journal entries in the appropriate governmental fund general journal and the government-wide governmental activities general journal for each of the following Rainbow City transactions.
Part B:
In the current year, the building occupied by Surf Beach City’s Culture and Recreation Department suffered severe structural damage as a result of a hurricane. It had been 48 years since a hurricane had hit the Rainbow City area, although hurricanes in Rainbow City’s geographic area are not uncommon. The building had been purchased 10 years earlier at a cost of $2,000,000 and had accumulated depreciation of $500,000 as of the date of the hurricane. Based on a restoration cost analysis, city engineers estimate the impairment loss at $230,000; however, the city expects during the next fiscal year to receive insurance recoveries of $120,000 for the damage.
Requirements:
In: Accounting
It is February 1, 2020 and you have been contacted by the owners of a proposed new restaurant in Columbus. This restaurant will be located on a piece of land near the Bradley Park area. The restaurant will emphasize fresh Mediterranean cuisine. The restaurant is the idea of two individuals that formerly worked for the Red Lobster’s Restaurant chain. The grand opening will be on April 2, 2020. The restaurant owners are aware of your expertise in small business and have asked you to develop an advertising plan for them. They have agreed to pay you
$ 3,500 for this project, plus your reasonable business expenses.
Using a budget accompanied by a narrative description, develop an advertising plan in outline form to present to the owners of the business. The owners are limited to only $ 8,000 for promotion and advertising until the company starts operations. From that point, the business will have to generate additional money for advertising from new sales. Please ensure that they know how their money will be used and why you believe your plan will attract customers.
The following information is to be used to determine your expenses:
Daily Newspapers: $600 for a quarter page ad on Sunday (20% of residents read the Ledger~Enquirer).
Television: Local affiliates will sell 30 second spots during the news for $ 10,000 per advertisement. Local cable companies will sell 30 second spots for $ 200.00 on ESPN.
Radio: A Rate Card for radio advertisements is not available for your analysis. For planning purposes, you can use the following rates:
Morning drive time (M - F; 6:00 - 10:00 am): $ 60 per day or five days for $ 180.00.
Evening drive time (M - F; 4:00 - 7:00 pm): $ 50 per day or five days for $ 130.00.
All other times: $ 20.00 per individual spot.
Magazines: N/A - no regional magazines are feasible as they cost $ 4,500 per monthly advertisement.
Billboards: Local billboards can be secured for a monthly package deal of $1,800 for three sites on I-185 north of Columbus or a package deal for $800 for two locations on Veterans Parkway. You must buy the package deal. You cannot buy individual billboards.
Direct Mail: A letter with two enclosed pieces of paper will cost you $ 0.75 per person to mail bulk rate.
Flyers: Flyers can be printed by the local print shop for $ 0.045 per sheet.
Student Newspaper: The student newspaper sells ad space at $150.00 for a quarter page ad. It has only 3,000 readers.
Other more creative, “boot-strapping” promotional techniques can be considered in your plan, but you must explain them.
|
Media |
January |
February |
March |
Total |
|
Radio |
||||
|
Saber |
||||
|
Ledger~Enquirer |
||||
|
Billboards |
||||
|
Flyers |
||||
|
Direct Mail |
||||
|
Website |
||||
|
Article in paper |
||||
|
Bootstrapping |
||||
|
Total |
In: Operations Management
The following information relates to Dane City during its fiscal year ended December 31, 20X2:
| Inventory—1/1/X2 | $ | 40,000 | |
| —12/31/X2 | 43,000 | ||
| Encumbrances outstanding—1/1/X2 | 4,000 | ||
| —12/31/X2 | 8,900 | ||
| Purchase orders during 20X2 | 194,000 | ||
| Amount credited to vouchers payable during 20X2 | 181,200 | ||
Required:
For items 1 through 10, determine the amounts based solely on the
preceding information.
1. What is the amount of 20X2 general fund transfers out?
general fund transfers out
2. How much should be reported in 20X2 as general fund liabilities
from entitlements for compensated absences?
general fund liabilities
3. What is the 20X2 assigned amount of the general fund
balance?
general fund balance
4. What is the 20X2 capital projects fund balance?
capital projects fund balance
5. What is the 20X2 fund balance on the special revenue fund for
tourist promotion?
special revenue fund
6. What is the amount of 20X2 debt service fund expenditures?
debt service fund expenditures
7. What amount should be included in the governmentwide financial
statements for the cost of long-term assets acquired in 20X2?
cost of long-term assets
8. What amount stemming from the 20X2 transactions and events
decreased the long-term debt liabilities reported in the
governmentwide financial statements?
amount of decrease
9. Using the purchases method, what is the amount of 20X2 supplies
expenditures?
supplies expenditures
10. What was the total amount of 20X2 supplies encumbrances?
supplies encumbrances
In: Accounting
There are four (4) questions based on the following article from the ABA Journal. The Ohio Supreme Court has reversed an award of more than $360,000 in a suit against a grocery store chain that provided a motorized shopping cart to a customer who caused a collision and injured the plaintiff. The court said Giant Eagle wasn’t liable because there is insufficient evidence that its actions caused the incident. The plaintiff in the case, Barbara Rieger, was injured in December 2012 at a Giant Eagle in Brook Park, Ohio, when another shopper, Ruth Kurka, hit Rieger’s shopping cart with her motorized cart, according to the Ohio Supreme Court’s September 19th opinion. Rieger, who had been standing at the bakery counter, was knocked to the ground and taken to the hospital by ambulance, incurring $11,511 in medical bills. Kurka died before trial, and her estate settled with Rieger for $8,500. At trial, Rieger provided deposition testimony by Kurka’s husband, who said his wife had never been trained on how to operate the motorized cart. Rieger also presented evidence that there were 117 incidents involving motorized cars at Giant Eagle stores from 2004 to 2012. Deposition testimony by a Giant Eagle representative submitted at trial established that there are no instructions for operation on the motorized carts, and Giant Eagle assumes that people who use the carts know how to drive them. Jurors also heard evidence that Kurka had been driving motorized carts for more than a year and had no prior incidents. Jurors awarded $121,000 in compensatory damages and nearly $1.2 million in punitive damages. An appeals court lowered the punitive damages to $242,000. On appeal, Giant Eagle contended that the appeals court had eliminated the need to prove negligence and made the store an insurer for motorized cart incidents when it affirmed the verdict. The Ohio Supreme Court agreed with Giant Eagle and said a trial judge should have granted a directed verdict to the grocery store chain. It isn’t enough for a plaintiff to assert or speculate that a defendant’s actions or failure to act might have caused an injury, the court said. Instead, the plaintiff has to show that the harm would not have occurred but for the defendant’s behavior. “Despite the fact that Giant Eagle does not provide training for its customers who use the motorized carts, there is no evidence that training would have prevented the accident in this case,” the court said.
Giant Eagle took exception to the decision of the appeals court when it “eliminated the need to prove negligence and made the store an insurer for motorized cart incidents when it affirmed the verdict.” Since it was a negligence case, which requirement to prove negligence is demonstrated by the Ohio Supreme Court’s statement that “Giant Eagle wasn’t liable because there is insufficient evidence that its actions caused the incident”?
Group of answer choices
Unreasonable Behavior
Proximate Causation
Duty of Care
Causation in Fact
In: Operations Management
A case can be made that sound reproduction has become one of the areas in which technological innovations have made the most profound leaps forward. Leading the way are major competitors such as Sony, Philips, Tivoli Audio, and Bose. Many forms of sound delivery exist, some featuring earphones and headphones, and others through stand-alone speakers.
The Bose Corporation began operations in 1964. Amar G. Bose, a professor of electrical engineering at the Massachusetts Institute of Technology, became frustrated during his attempt to purchase a high-quality stereo system. He believed that the speakers that were available had impressive technical specifications but failed to reproduce the realism of a live performance.
Four years later, the first Bose product reached the market. In a very short time, Bose has delivered a series of innovations in sound.
Currently, the Bose Wave products are at the forefront of quality sound, including the Wave radio, Wave music system, and Acoustic Wave music system. Each is designed to deliver the most realistic sound through a compact, attractive device that will fit in any room in the home or office. The product can be linked with a dock that both plays and recharges an iPod. Another product allows the user to wirelessly play and store music from an internet radio station. Other Bose products include headphones, home theater systems, speakers, and sound systems for various locations, including boats and businesses.
Bose systems are on the high end in terms of price. For example, the most widely purchased Wave music system had a list price of $499.95 in November 2009. To entice buyers, product discounts are routinely offered, including a $100.00 price reduction when the Wave is purchased with the accompanying multi-CD changer. Also, Bose offers one-year, interest-free financing.
The Bose marketing program includes use of traditional media, most notably television, newspaper, and magazine advertising. The company’s website allows buyers to find and purchase all items online. The company employs a limited number of retail stores that feature the Bose line. The primary marketing emphasis remains focused on quality. For example, Fortune rated the Bose QuietComfort headset, which cancels outside noise, as the best-quality option for headphones.
Although a company’s reputation for quality may help to drive sales, outside factors can interfere. The recession that began in 2008 and continued into 2009 led many shoppers to cut back purchases, especially for more expensive luxury items. Bose was not immune to this trend. The company was forced to lay off nearly 1,000 workers, or 10 percent of its labor force, during the decline.
At the same time, Bose forged ahead, seeking to develop new technologies in areas other than sound. As the economy continues to recover, business analysts expect Bose to build on its core products while moving into new areas, furthering the growth of this innovative, energetic organization.
Questions
(1) Explain how the IMC planning process would apply to future marketing efforts for Bose Wave products.
(2)Identify the market segments that the Bose Wave products should continue to maintain.
(3) Should Bose continue to compete based on the high-price/high-quality positioning, or develop programs to reduce prices and entice a wider variety of shoppers?
(4) What should be the primary marketing communications objectives for Bose?
(5) What type of budget should be used for the Bose promotional program?
(6) Which IMC components best match the target market, position, objectives, and budget for Bose products?
In: Economics
Assignment Purpose
The purpose of this lab is to write a well commented java program that demonstrates the use of two dimensional arrays, input validation, and methods. (Write by Java Code, Need Comment)
Instructions
Seat Ticket Price
10 10 10 10 10 10 10 10 10 10
10 10 10 10 10 10 10 10 10 10
10 10 10 10 10 10 10 10 10 10
10 10 20 20 20 20 20 20 10 10
10 10 20 20 20 20 20 20 10 10
10 10 20 20 20 20 20 20 10 10
20 20 30 30 40 40 30 30 20 20
20 40 50 50 50 50 50 50 40 20
80 50 50 80 80 80 80 50 50 30
Seating Arrangement: Seats No.
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
31 32 33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48 49 50
51 52 53 54 55 56 57 58 59 60
61 62 63 64 65 66 67 68 69 70
71 72 73 74 75 76 77 78 79 80
81 82 83 84 85 86 87 88 89 90
Hint: Basically, you will search the 2D array for the input price, and as soon as you find a matching price, you will replace the price at that location with a 0.
Sample output 1
Please pick a price or press Q to quit: 80
Checking for the availability……
Your seat is confirmed! Your seat number is 81. Enjoy your movie
Please pick a price or press Q to quit: 80
Checking for the availability……
No seat at this price is available. Sorry!
Please pick a price or press Q to quit: Q
Thank you for using our online ticketing
service. Goodbye!
Sample output 2
Please pick a price or press Q to quit: 10
Checking for the availability……
Your seat is confirmed! Your seat number is 1. Enjoy your movie
Please pick a price or press Q to quit: 20
Checking for the availability……
Your seat is confirmed! Your seat number is 33. Enjoy your movie
Please pick a price or press Q to quit: 20
Checking for the availability……
Your seat is confirmed! Your seat number is 34. Enjoy your movie
Please pick a price or press Q to quit: 200
Please pick a valid price. Valid prices are $10, $20, $30, $40, $50, and $80
Please pick a price or press Q to quit: Q
Thank you for using our online ticketing service. Goodbye!
In: Computer Science
In: Operations Management
The following VHDL code has errors and is not working in Umhdl. please solve the errors for the following code and rewrite the code here and show the output.
The code:
library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.std_logic_unsigned.all; entity Car_Parking_System_VHDL is port ( clk,reset_n: in std_logic; -- clock and reset of the car parking system front_sensor, back_sensor: in std_logic; -- two sensor in front and behind the gate of the car parking system password_1, password_2: in std_logic_vector(1 downto 0); -- input password GREEN_LED,RED_LED: out std_logic; -- signaling LEDs HEX_1, HEX_2: out std_logic_vector(6 downto 0) -- 7-segment Display ); end Car_Parking_System_VHDL; architecture Behavioral of Car_Parking_System_VHDL is -- FSM States type FSM_States is (IDLE,WAIT_PASSWORD,WRONG_PASS,RIGHT_PASS,STOP); signal current_state,next_state: FSM_States; signal counter_wait: std_logic_vector(31 downto 0); signal red_tmp, green_tmp: std_logic; begin -- Sequential circuits process(clk,reset_n) begin if(reset_n='0') then current_state <= IDLE; elsif(rising_edge(clk)) then current_state <= next_state; end if; end process; -- combinational logic process(current_state,front_sensor,password_1,password_2,back_sensor,counter_wait) begin case current_state is when IDLE => if(front_sensor = '1') then -- if the front sensor is on, -- there is a car going to the gate next_state <= WAIT_PASSWORD;-- wait for password else next_state <= IDLE; end if; when WAIT_PASSWORD => if(counter_wait <= x"00000003") then next_state <= WAIT_PASSWORD; else -- check password after 4 clock cycles if((password_1="01")and(password_2="10")) then next_state <= RIGHT_PASS; -- if password is correct, let them in else next_state <= WRONG_PASS; -- if not, tell them wrong pass by blinking Green LED -- let them input the password again end if; end if; when WRONG_PASS => if((password_1="01")and(password_2="10")) then next_state <= RIGHT_PASS;-- if password is correct, let them in else next_state <= WRONG_PASS;-- if not, they cannot get in until the password is right end if; when RIGHT_PASS => if(front_sensor='1' and back_sensor = '1') then next_state <= STOP; -- if the gate is opening for the current car, and the next car come, -- STOP the next car and require password -- the current car going into the car park elsif(back_sensor= '1') then -- if the current car passed the gate an going into the car park -- and there is no next car, go to IDLE next_state <= IDLE; else next_state <= RIGHT_PASS; end if; when STOP => if((password_1="01")and(password_2="10"))then -- check password of the next car -- if the pass is correct, let them in next_state <= RIGHT_PASS; else next_state <= STOP; end if; when others => next_state <= IDLE; end case; end process; -- wait for password process(clk,reset_n) begin if(reset_n='0') then counter_wait <= (others => '0'); elsif(rising_edge(clk))then if(current_state=WAIT_PASSWORD)then counter_wait <= counter_wait + x"00000001"; else counter_wait <= (others => '0'); end if; end if; end process; -- output process(clk) -- change this clock to change the LED blinking period begin if(rising_edge(clk)) then case(current_state) is when IDLE => green_tmp <= '0'; red_tmp <= '0'; HEX_1 <= "1111111"; -- off HEX_2 <= "1111111"; -- off when WAIT_PASSWORD => green_tmp <= '0'; red_tmp <= '1'; -- RED LED turn on and Display 7-segment LED as EN to let the car know they need to input password HEX_1 <= "0000110"; -- E HEX_2 <= "0101011"; -- n when WRONG_PASS => green_tmp <= '0'; -- if password is wrong, RED LED blinking red_tmp <= not red_tmp; HEX_1 <= "0000110"; -- E HEX_2 <= "0000110"; -- E when RIGHT_PASS => green_tmp <= not green_tmp; red_tmp <= '0'; -- if password is correct, GREEN LED blinking HEX_1 <= "0000010"; -- 6 HEX_2 <= "1000000"; -- 0 when STOP => green_tmp <= '0'; red_tmp <= not red_tmp; -- Stop the next car and RED LED blinking HEX_1 <= "0010010"; -- 5 HEX_2 <= "0001100"; -- P when others => green_tmp <= '0'; red_tmp <= '0'; HEX_1 <= "1111111"; -- off HEX_2 <= "1111111"; -- off end case; end if; end process; RED_LED <= red_tmp ;
VHDL testbench code:
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY tb_car_parking_system_VHDL IS
END tb_car_parking_system_VHDL;
ARCHITECTURE behavior OF tb_car_parking_system_VHDL IS
-- Component Declaration for the car parking system in VHDL
COMPONENT Car_Parking_System_VHDL
PORT(
clk : IN std_logic;
reset_n : IN std_logic;
front_sensor : IN std_logic;
back_sensor : IN std_logic;
password_1 : IN std_logic_vector(1 downto 0);
password_2 : IN std_logic_vector(1 downto 0);
GREEN_LED : OUT std_logic;
RED_LED : OUT std_logic;
HEX_1 : OUT std_logic_vector(6 downto 0);
HEX_2 : OUT std_logic_vector(6 downto 0)
);
END COMPONENT;
--Inputs
signal clk : std_logic := '0';
signal reset_n : std_logic := '0';
signal front_sensor : std_logic := '0';
signal back_sensor : std_logic := '0';
signal password_1 : std_logic_vector(1 downto 0) := (others => '0');
signal password_2 : std_logic_vector(1 downto 0) := (others => '0');
--Outputs
signal GREEN_LED : std_logic;
signal RED_LED : std_logic;
signal HEX_1 : std_logic_vector(6 downto 0);
signal HEX_2 : std_logic_vector(6 downto 0);
-- Clock period definitions
constant clk_period : time := 10 ns;
BEGIN
-- Instantiate the car parking system in VHDL
Car_park_system: Car_Parking_System_VHDL PORT MAP (
clk => clk,
reset_n => reset_n,
front_sensor => front_sensor,
back_sensor => back_sensor,
password_1 => password_1,
password_2 => password_2,
GREEN_LED => GREEN_LED,
RED_LED => RED_LED,
HEX_1 => HEX_1,
HEX_2 => HEX_2
);
-- Clock process definitions
clk_process :process
begin
clk <= '0';
wait for clk_period/2;
clk <= '1';
wait for clk_period/2;
end process;
-- Stimulus process
stim_proc: process
begin
reset_n <= '0';
front_sensor <= '0';
back_sensor <= '0';
password_1 <= "00";
password_2 <= "00";
wait for clk_period*10;
reset_n <= '1';
wait for clk_period*10;
front_sensor <= '1';
wait for clk_period*10;
password_1 <= "01";
password_2 <= "10";
wait until HEX_1 = "0000010";
password_1 <= "00";
password_2 <= "00";
back_sensor <= '1';
wait until HEX_1 = "0010010"; -- stop the next car and require password
password_1 <= "01";
password_2 <= "10";
front_sensor <= '0';
wait until HEX_1 = "0000010";
password_1 <= "00";
password_2 <= "00";
back_sensor <= '1';
wait until HEX_1 = "1111111";
back_sensor <= '0';
-- insert your stimulus here
wait;
end process;
END;In: Computer Science
Mrs. Anna Temple, A 40-year-old African American woman, arrives at the emergency room, with her husband Joe. According to Mr. Temple, his wife woke up at 7 am to get ready for work. Mrs. Temple was unable to get out of bed due to weakness in her left arm and left leg. Mr. Temple also noticed the left side of his wife’s face was drooping. Upon arrival at the ED, Anna Temple had a left facial droop, left-sided hemiparesis, expressive aphasia, and mild dysphagia.
Anna’s past medical history includes atrial fibrillation (afib), hypertension, hyperlipidemia, and Type 2 Diabetes (NIDDM), anxiety, and depression. Anna’s past surgical history includes: hysterectomy, cholecystectomy, right knee arthroscopy, and incision and debridement of a left groin abscess.
Anna is awake, alert, and oriented x 3. Anna is unable to verbalize answers to questions due to expressive aphasia but is able to nod yes/no to staff. Heart rate is 101, and irregular. Lungs are clear bilaterally. O2 sat is 98% on RA. She has positive bowel sounds, positive +2 pedal pulses, and +1 bilateral edema of her lower legs. Anna’s husband reports that Anna has been complaining of numbness and tingling to her feet. Anna has also been c/o nausea and loss of appetite, and loose stools for 3 days. Anna is straight catheterized for a urine specimen. 300 cc of dark amber malodorous urine. Anna is quickly taken for a CT scan of the brain.
Vital signs, T: 37, HR, 101 irreg, RR 24, BP 188/98. Anna denies pain. Her blood sugar on admission was 242. #18 gauge IPID RFA.
Social History: Obtained from Mr. Temple. (while Anna was in CT scan).
Anna and Joe Temple have been married for 20 years. They have twin daughters, age 19, and a son, age 16. Their daughters are both freshmen in college, and their son is a sophomore in high school. Last year, Anna’s mother, who has early onset dementia, came to live with them after Anna’s father passed away from a heart attack. Joe’s parents live next door, and both have many medical appointments which Joe and Anna help take them to. Anna works full time as an administrative assistant for an insurance company. Anna often confides in Joe that her job is very stressful and rarely is able to get away from her desk for lunch or a break. Joe also says that Anna is always taking care of everyone else and is not consistent with her medications or her own doctor’s appointments. Anna has smoked 1 ppd for the last 20 years.
MEDS: Daily/PRN: Glucophage 500 mg po BID, Lopressor 25 mg po BID, Lipitor 20 mg po QD, Xarelto 20 mg po QD, Neurontin 300 mg po TID, Multivitamin 1 po QD, Premarin 0.3 mg po QD, Zoloft 100 mg po QD
Lab Results:
RBC 4.1 Platelets- 450,000 CL 110
WBC 16.2 INR 1.0 Mag 1.4
HGB 11g/dl K 2.8 Hbg A1C 12 %
HCT 32.3% Na 148 Glucose 259
·Urinalysis: +2 bacteria, +3 leukocytes, +2 protein, trace RBCs,
·Diagnostic tests: non contrast CT scan: thrombolytic CVA.
·CXR: bilat bibasilar atelectasis, EKG: afib,
Mrs. Temple has returned from CT scan and tPA is administered per protocol.
In addition to tPA, the physician enters the following orders:
IV 0.9 NSS 125 cc/o, Vital signs & Neuro checks q 15 min x 4, then Q 30 min x2, then Q 1 hr. NPO until swallowing evaluation. 1 GM Rocephin IV, novolog per sliding scale, BGM ac and hs.
After Mrs. Temple’s vital signs stabilized, she was transferred to the neuro medical surgical unit with admission diagnoses of CVA, LSW, uncontrolled DM, HTN, and +UTI
STROKE:
1. What is tPA, and why was it appropriate for Mrs. Temple?
2. Why is Mrs. Temple NPO?
3. What were Mrs.Temple’s risk factors for stroke?
4. Explain how knowing the type of CVA is an important factor in treatment.
5. What is the NIH stroke scale?
6. Why would it be important to continue neuro checks in the hours following a CVA?
MEDICATIONS:
7. Why do you think Anna Temple was prescribed each of these medications (look at home medications)
8. Which of these medications may be contraindicated for Anna Temple based on her medical and surgical history?
SOCIAL HX:
9. What additional risk factors are noted in the social hx information? How do these risk factors affect other aspects of Mrs. Temple’s health…..DM, HTN, Anxiety, Depression….
It is now 3 days post CVA for Mrs. Anna Temple, Anna’s deficits continue to improve, she is ambulating with a walker and standby assist. She is tolerating a LFLC consistent carb diet regular consistency with honey thick liquids. Anna is pleasant but with a very flat affect, very tearful at times. Anna’s vital signs and blood sugars are now within normal range. Anna will likely be discharged to acute inpatient rehab prior to transitioning to home.
10. What diagnostic test was likely done by the speech therapist to determine that Anna needed honey thick liquids for safe swallowing?
11. Identify actions to help Mr. and Mrs. Temple as they learn to cope with Mrs. Temple’s recovery and the other responsibilities of their busy lives.
In: Nursing
In this assignment, you will be implementing a slot machine that you find in casinos. A slot machine has certain number of reels which spin to produce one of a fixed set of symbols (e.g. flowers, bells) randomly when the user pulls a lever. The user needs to insert certain number of currency units as wager into the slot machine before pulling the lever. We refer to these currency units as “wagerUnitValue”. For example in slot machines with quarter (25 cents) as wagerUnitValue , user needs to insert one or more quarters while in dollar slot machines where wagerUnitValue = 100, user needs to insert one or more dollars as wager before pulling the lever. The user will receive a payout based on the matching of symbols on the reels. In a real slot machine there is a payout table which specifies the payout for certain combinations of symbols on the reels. In this assignment, you will instead be implementing simple payout rules based on number of matched symbols.
I have provided a skeletal implementation of a slot machine to help you get started (Check Moodle). Do not change class name, enum type or function signatures. You can however add some variables as needed. Specifically implement the following functions: (a) SlotMachine class constructor which has the following parameters: (i) numReels, (ii) odds array with one entry per symbol indicating probability of getting the symbol in a reel and (iii) wagerUnitValue in cents. (b) getSymbolForAReel() – use Math.random() to generate a random number between 0 and 1 and then use the odds array to generate a symbol randomly. (c) calcPayout() – calculate and return payout value for the given symbols on the reels; use the rules provided in the comments section of the function (d) pullLever() – this function simulates user pulling lever in the slot machine after inserting a wager. First use the function in (b), to generate symbol for each reel and then use the function in (c) to calculate the payout. You can assume that the symbols on the reels appear as independent random events. You need to print the reel symbols in a line followed by the payout in dollar format in another line. (e) getPayoutPercent() – you need to keep track of total wager given by the user as well as total payout provided to the user; this function calculates the total payout as a percent of the total wager value. (f) reset() – clears the total wager and total payout value for fresh calculation of payout percent. Submit only the SlotMachine.java file with your name added in comments section. You can use the main() function to test your program but it is not graded. The test program used for grading will call the class functions (a)-(f) directly.
package edu.stevens.cs570.assignments;
public class SlotMachine {
public enum Symbol {
BELLS("Bells", 10), FLOWERS("Flowers", 5), FRUITS("Fruits", 3),
HEARTS("Hearts", 2), SPADES("Spades", 1);
// symbol name
private final String name;
// payout factor (i.e. multiple of wager) when matching symbols of this
type
private final int payoutFactor;
Symbol(String name, int payoutFactor) {
this.name = name;
this.payoutFactor = payoutFactor;
}
public String getName() {
return name;
}
public int getPayoutFactor() {
return payoutFactor;
}
}
/**
* Constructor
* @param numReels number of reels in slot machine
* @param odds odds for each symbol in a reel, indexed by its enum ordinal
value; odds value is non-zero and sums to 1
* @param wagerUnitValue unit value in cents of a wager
*/
public SlotMachine(int numReels, double [] odds, int wagerUnitValue) {
}
/**
* Get symbol for a reel when the user pulls slot machine lever
* @return symbol type based on odds (use Math.random())
*/
public Symbol getSymbolForAReel() {
return null;
}
/**
* Calculate the payout for reel symbols based on the following rules:
* 1. If more than half but not all of the reels have the same symbol then
payout factor is same as payout factor of the symbol
* 2. If all of the reels have the same symbol then payout factor is twice the
payout factor of the symbol
* 3. Otherwise payout factor is 0
* Payout is then calculated as wagerValue multiplied by payout factor
* @param reelSymbols array of symbols one for each reel
* @param wagerValue value of wager given by the user
* @return calculated payout
*/
public long calcPayout(Symbol[] reelSymbols, int wagerValue) {
return 0;
}
/**
* Called when the user pulls the lever after putting wager tokens
* 1. Get symbols for the reels using getSymbolForAReel()
* 2. Calculate payout using calcPayout()
* 3. Display the symbols, e.g. Bells Flowers Flowers..
* 4. Display the payout in dollars and cents e.g. $2.50
* 5. Keep track of total payout and total receipts from wagers
* @param numWagerUnits number of wager units given by the user
*/
public void pullLever(int numWagerUnits) {
}
/**
* Get total payout to the user as percent of total wager value
* @return e.g. 85.5
*/
public double getPayoutPercent() {
return 0;
}
/**
* Clear the total payout and wager value
*/
public void reset() {
}
public static void main(String [] args) {
double [] odds = new double[Symbol.values().length];
// sum of odds array values must equal 1.0
odds[Symbol.HEARTS.ordinal()] = 0.3;
odds[Symbol.SPADES.ordinal()] = 0.25;
odds[Symbol.BELLS.ordinal()] = 0.05;
odds[Symbol.FLOWERS.ordinal()] = 0.2;
odds[Symbol.FRUITS.ordinal()] = 0.2;
SlotMachine sm = new SlotMachine(3, odds, 25); // quarter slot machine
sm.pullLever(2);
sm.pullLever(1);
sm.pullLever(3);
System.out.println("Pay out percent to user = " + sm.getPayoutPercent());
sm.reset();
sm.pullLever(4);
sm.pullLever(1);
sm.pullLever(1);
sm.pullLever(2);
System.out.println("Pay out percent to user = " + sm.getPayoutPercent());
}
}
This is Sample Output:
Spades Hearts Flowers
payout=$0.00
Flowers Hearts Hearts
payout=$0.50
Flowers Spades Spades
payout=$0.75
Pay out percent to user = 83.33333333333333
Spades Flowers Hearts
payout=$0.00
Spades Hearts Flowers
payout=$0.00
Fruits Hearts Hearts
payout=$0.50
Hearts Spades Fruits
payout=$0.00
Pay out percent to user = 25.0
In: Computer Science