11. In the 5-Stage DuPont ROE formula, which of the following is considered a utilization ratio:
a. NI / EBT or the tax burden ratio
b. EBT / EBIT or the interest burden ratio
c. EBIT / Sales or the operating margin
d. Sales / TA or total asset turnover ratio
e. TA / SE or the leverage ratio
12. During lecture and on the lecture slides, we evaluated Vulcan Materials’ operating margin over a full 10 year business cycle. Because Vulcan Materials’ operating margin ________ when economic conditions deteriorate (e.g. during the housing crisis), Vulcan Material’s would best be categorized as a ________.
a. decreases ; cyclical company
b. increases ; cyclical company
c. decreases ; non-cyclical company
d. increases ; non-cyclical company
e. increases ; counter-cyclical company
13. You owe your credit company $25,000 and plan to make no payments on your credit card for 1.0 year. Due to your current credit score, your credit card company charges you an APR of 30.0%. If, however, you took measures to increase your credit score by 100points, your credit card company would instantaneously adjust your APR by 5.0%. How much would you save over 1.0 year if you took actions to increase your credit score?
a. $1,525
b. $1,603
c. $1,677
d. $8,622
e. $8,717
14. You are the beneficiary of a trust set up by your grandparents. You will receive a total of 60 after tax cash flows ($1,000 each) beginning six years from now (T=6) when you turn age 25. These payments are intended to help cover your living expenses over the course of your expected lifetime. Assume the appropriate discount rate is 6.0% per annum. What is the present value of the 60 payments?
a. $11,372
b. $11,393
c. $12,077
d. $12,098
e. $16,667
15. You have $1000 in a savings account today (T=0). Approximately how much longer would it take for your investment to double (i.e. to become worth $2000) if you earned 4.0% on your savings as opposed to 12.0% at the end of every calendar year? Hint: Think Rule of 72.
a. 6 years
b. 8 years
c. 12 years
d. 16 years
e. 18 years
In: Finance
Using Minitab, use the regression model with all nine independent variables to test the hy- potheses H0 : βAGE = −2500 vs. Ha : βAGE < −2500. Use α = 0.05 and include all steps of a hypothesis test.
Row PRICE BATHS
BEDA BEDB BEDC CARA
CARB AGE LOT
DOM
1 25750 1.0 1
0 0 1 0
23 9680 164
2 37950 1.0 0
1 0 0 1
7 1889 67
3 46450 2.5 0
1 0 0 0
9 1941 315
4 46550 2.5 0
0 1 1 0
18 1813 61
5 47950 1.5 1
0 0 0 1
2 1583 234
6 49950 1.5 0
1 0 0 0
10 1533 116
7 52450 2.5 0
0 1 0 0
4 1667 162
8 54050 2.0 0
1 0 0 1
5 3450 80
9 54850 2.0 0
1 0 0 0
5 1733 63
10 52050 2.5 0
1 0 0 0
5 3727 102
11 54392 2.5 0
1 0 0 0
7 1725 48
12 53450 2.5 0
1 0 0 0
3 2811 423
13 59510 2.5 0
1 0 0 1
11 5653 130
14 60102 2.5 0
1 0 0 0
7 2333 159
15 63850 2.5 0
0 1 0 0
6 2022 314
16 62050 2.5 0
0 0 0 0
5 2166 135
17 69450 2.0 0
1 0 0 0
15 1836 71
18 82304 2.5 0
0 1 0 0
8 5066 338
19 81850 2.0 0
1 0 0 0
0 2333 147
20 70050 2.0 0
1 0 0 0
4 2904 115
21 112450 2.5 0
0 1 0 0
1 2930 11
22 127050 3.0 0
0 1 0 0
9 2904 36
In: Statistics and Probability
/ File: temperature.cxx
// This program prints a table to convert numbers from one unit to
another.
// The program illustrases some implementation techniques.
#include // Provides cout
#include // Provides setw function for setting output width
#include // Provides EXIT_SUCCESS
#include // Provides assert function
using namespace std; // Allows all standard library items to be
used
double celsius_to_fahrenheit(double c)
// Precondition: c is a Celsius temperature no less than
absolute
// zero (-273.16).
// Postcondition: The return value is the temperature c converted
to Fahrenheit
// degrees.
{
const double MINIMUM_CELSIUS = -273.16; // Absolute zero in Celsius
degrees
assert(c >= MINIMUM_CELSIUS);
return (9.0 / 5.0) * c + 32;
}
void setup_cout_fractions(int fraction_digits)
// Precondition: fraction_digits is not negative.
// Postcondition: All double or float numbers printed to cout will
now be
// rounded to the specified digits on the right of the
decimal.
{
assert(fraction_digits > 0);
cout.precision(fraction_digits);
cout.setf(ios::fixed, ios::floatfield);
if (fraction_digits == 0)
cout.unsetf(ios::showpoint);
else
cout.setf(ios::showpoint);
}
int main( )
{
const char HEADING1[] = " Celsius"; // Heading for table's 1st
column
const char HEADING2[] = "Fahrenheit"; // Heading for table's 2nd
column
const char LABEL1 = 'C'; // Label for numbers in 1st column
const char LABEL2 = 'F'; // Label for numbers in 2nd column
const double TABLE_BEGIN = -50.0; // The table's first Celsius
temp.
const double TABLE_END = 50.0; // The table's final Celsius
temp.
const double TABLE_STEP = 10.0; // Increment between
temperatures
const int WIDTH = 9; // Number chars in output numbers
const int DIGITS = 1; // Number digits right of decimal pt
double value1; // A value from the table's first column
double value2; // A value from the table's second column
// Set up the output for fractions and print the table
headings.
setup_cout_fractions(DIGITS);
cout << "CONVERSIONS from " << TABLE_BEGIN << "
to " << TABLE_END << endl;
cout << HEADING1 << " " << HEADING2 <<
endl;
// Each iteration of the loop prints one line of the table.
for (value1 = TABLE_BEGIN; value1 <= TABLE_END; value1 +=
TABLE_STEP)
{
value2 = celsius_to_fahrenheit(value1);
cout << setw(WIDTH) << value1 << LABEL1 <<
" ";
cout << setw(WIDTH) << value2 << LABEL2 <<
endl;
}
return EXIT_SUCCESS;
}
1) The source code must be well structured like include relevant comments like on the top include the version like 1.0 and 1.1, date, and a brief description of what the program does.
2) . As you make changes you
can add one line description of the changes and change the version
# or add a version #
like version 1.0 and 1.1
3) Write a short report (not to exceed 100 words) that describes the work done, the input, and output when executing the program.
In: Computer Science
12. In a solution, when the concentrations of a weak acid and its conjugate base are equal,….
[A] the system is not at equilibrium
[B] the -log of the [H+] and the -log of the Ka are equal
[C] the buffering capacity is significantly decreased
[D] the buffering capacity is significantly increased
[E] All of the above are true.
13. The concentration of iodide ions in a saturated solution of lead (II) iodide is ________ M.
The solubility product constant of PbI2 is 1.4 x 10-8.
[A] 1.4 x 10-8 [B] 1.5 x 10-3 [C] 3.5 x 10-9 [D] 3.8 x 10-4 [E] 3.0 x 10-3
14. The solubility of lead (II) chloride (PbCl2) is 1.6 x 10-2 M. What is the Ksp of PbCl2?
[A] 4.1 x 10-6 [B] 1.6 x 10-5 [C] 3.1 x 10-7 [D] 5.0 x 10-4 [E] 1.6 x 10-2
15. The solubility of manganese (II) hydroxide (Mn(OH)2) is 2.2 x 10-5 M. What is the Ksp of
Mn(OH)2?
[A] 2.2 x 10-5 [B] 2.1 x 10-14 [C] 1.1 x 10-14 [D] 4.8 x 10-10 [E] 4.3 x 10-14
16. Which of these expressions correctly expresses the solubility-product constant for
Ag3PO4 in water?
[A] [Ag][PO4] [B] [Ag+][PO43−] [C] [Ag+]3[PO43−]
[D] [Ag+][PO43−]3 [E] [Ag+]3[PO43−]3
17. A solution of NaF is added dropwise to a solution that is 0.0166 M in Ba2+. When the
concentration of F- exceeds ________ M, BaF2 will precipitate. Neglect volume changes.
For BaF2, Ksp = 1.7 ⋅ 10-6.
[A] 1.0 x 10-2 [B] 1.0 x 10-4 [C] 5.1 x 10-5 [D] 2.5 x 10-3 [E] 2.8 x 10-8
18. A solution contains 2.3 x 10-4 M Ag+ and NaI solution is being added drop wise. What
is the minimum concentration of I- to begin precipitation of AgI? Ksp (AgI)= 8.3 x 10-17
[A] 8.32 x10-17 M [B] 2.51 x 10-17 M [C] 3.01 x 10-15
[D] 3.51 x 10-14 M [E] 3.61 x 10-13 M
In: Chemistry
Program Requirements:
This assignment requires you to create one program in
Java to simulate a Point-of-Sale (POS) system. The
solution must be in JAVA language.
You create the main program called POSmain.java and two classes:
ShoppingCart and CashRegister.
Your POSmain program should take three file names from command line
arguments. The first file contains a list of products and their
prices; the second and third files are lists of items in two
shopping carts of two customers. The POSmain program should first
read the price file, then read each of the cart files to load a
list of items in a shopping cart and store them in a ShoppingCart
objects. The price file may contain a variable number of products
and the cart files may contain a variable number of items.
POSmain then will create a CashRegister object by passing the price
list to it. The POSmain program then will use the CashRegister
object to scan items in a cart and print a receipt for each
shopping cart one by one. At last, POSmain will use the
CashRegister object to print a report for the day.
The students will the report for the day, which requires design of
your CashRegister class.
cart1.txt:
TV
Table
Table
Bed
Bed
Chair
Chair
Chair
Chair
cart2.txt:
Milk
Butter
Tomato
Tomato
Tomato
Tomato
Tomato
Onion
Onion
Onion
Lettuce
Milk
Ham
Bread
Bread
price.txt:
TV
999.99
Table 199
Bed 499.99
Chair 45.49
Milk 3.00
Butter 2.84
Tomato 0.76
Onion 0.54
Lettuce 1.00
Ham 2.50
Bread 1.75
Program Output:
One customer is checking out ...
========================================
Product Price Qty Subtotal
----------------------------------------
Bed $499.99 2 $999.98
Char $45.49 4 $181.96
TV $999.99 1 $999.99
Table $199.0 2 $398.0
-------------------------
Total $2579.93
========================================
One customer is checking out ...
========================================
Product Price Qty Subtotal
----------------------------------------
Bread $1.75 2 $3.5
Butter $2.84 1 $2.84
Ham $2.5 1 $2.5
Lettuce $1.0 1 $1.0
Milk $3.0 2 $6.0
Onions $0.54 3 $1.62
Tomato $0.76 5 $3.8
-------------------------
Total $21.26
========================================
Report for the day
========================================
Number of customers: 2
Total sale: $2601.19
List of products sold:
----------------------------------------
Product Qty
----------------------------------------
Bed 2
Bread 2
Butter 1
Char 4
Ham 1
Lettuce 1
Milk 2
Onions 3
TV 1
Table 2
Tomato 5
In: Computer Science
Boatbound
Serial entrepreneur Aaron Hall took note of the “sharing economy” that emerged during the last recession and launched Boatbound, a peer-to-peer boat rental company that brings together boat owners who are willing to rent their boats when they are not in use and people who want a fun boating experience without the cost of owning a boat. Hall realized that 12.2 million boats are registered in the United States, yet the average owner uses his or her boat just 26 days per year. Boatbound screens all potential renters, verifies the condition and the safety of each boat, carries ample insurance on each boat, and covers general liability. Boat owners select their renters from Boatbound’s pool of applicants and set daily rental fees, and Boatbound collects 35 percent of the fee. Boatbound has rented every kind of boat, from kayaks to yachts with captains. Fees range from $200 to $8,500 per day. “As a boat owner and someone in the marine industry, I’ve been waiting for something like this my whole life,” says Aabad Melwani, owner of a marina. “I just didn’t know it.”
Henrybuilt
Scott Hudson, CEO of Henrybuilt, had created a profitable niche designing and building upscale kitchens that ranged from $30,000 to $100,000. In 2006, Hudson opened a New York City showroom, which doubled in size in just 18 months. By 2008, the company had more than 200 jobs in the United States, Mexico, and Canada. When the recession hit, however, new projects came to a standstill, and customers began cancelling orders. In response, Hudson launched a subsidiary, Viola Park Corporation, that provides customers lower-cost remodeling options that use its software rather than an architect to create “custom” variations on Henrybuilt designs. The result is a process that produces a kitchen much faster and at half the cost of a Henrybuilt kitchen. Henrybuilt sales have recovered, but Viola Park accounts for 20 percent of sales and is growing twice as fast as Henrybuilt. Unequal Technologies Robert Vito started Unequal Technologies in 2008 to supply protective clothing and gear, including bullet-proof vests, to military contractors. The protective gear is made from a lightweight yet strong composite material that he developed and patented. Two years later, the equipment manager of the Philadelphia Eagles called to ask whether Unequal Technologies could create a special garment for one of its star players who had suffered a sternum injury. Vito modified the bullet-proof vest for the player and soon had other players in the National Football League asking for protective gear. Unequal technologies went on to develop Concussion Reduction Technology (CRT), peel-and-stick pads for football helmets that are made from before it reaches the skull. Independent tests show that CRT reduces the risk of head injuries from impact by 53 percent. The company now supplies equipment to 27 of the NFL’s 32 teams and has its sights set on an even larger market: amateur sports. Vito says Unequal’s technology gives the company a competitive edge that has allowed it to increase sales from $1 million to $20 million in just one year.
(Source: Scarborough and Cornwall, 2016)
Select one of these small businesses (Boatbound or Henrybuilt) and explain how the said business used six (6) of the 10 types of innovation to bolster its success.
Marks)
In: Operations Management
Please prepare a PowerPoint presentation of the following case.
During the late 1980s, the decline in Akron’s tire industry, inflation, and changes in governmental priorities almost resulted in the permanent closing of the Akron Children’s Zoo. Lagging attendance and a low level of memberships did not help matters. Faced with uncertain prospects of continuing, the city of Akron opted out of the zoo business. In response, the Akron Zoological Park was organized as a corporation to contract with the city to operate the zoo.
The Akron Zoological Park is an independent organization that manages the Akron Children’s Zoo for the city. To be successful, the Zoo must maintain its image as a high-quality place for its visitors to spend their time. Its animal exhibits are clean and neat. The animals, birds, and reptiles are carefully looked after. As resources become available for construction and continuing operations, the Zoo keeps adding new exhibits and activities. Efforts seem to be working, because attendance increased from 53,353 in 1989 to an all-time record of 133,762 in 1994.
Due to its northern climate, the Zoo conducts its open season from mid-April until mid-October. It reopens for one week at Halloween and for the month of December. Zoo attendance depends largely on the weather. For example, attendance was down during the month of December 1995, which established many local records for the coldest temperatures and the most snow. Variations in weather also affect crop yields and prices for fresh animal foods, thereby influencing the costs of animal maintenance.
In normal circumstances, the zoo may be able to achieve its target goal and attract an annual attendance equal to 40% of its community. Akron has not grown appreciably during the past decade. But the Zoo became known as an innovative community resource, and as indicated in the table, annual paid attendance has doubled. Approximately 35% of all visitors are adults. Children account for one-half of the paid attendance. Group admissions remain a constant 15% of zoo attendance.
The Zoo does not have an advertising budget. To gain exposure in its market, the Zoo depends on public service announcements, its public television series, and local press coverage of its activities and social happenings. Many of these activities are but a few years old. They are a strong reason that annual zoo attendance has increased. Although the Zoo is a nonprofit organization, it must ensure that its sources of income equal or exceed its operating and physical plant costs. Its continued existence remains totally dependent on its ability to generate revenues and to reduce its expenses.
Source: Professor F. Bruce Simmons III, University of Akron.
|
YEAR |
ATTENDANCE |
ADMISSION FEE ($) |
||
|
ADULT |
CHILD |
GROUP |
||
|
1998 |
117,874 |
4.00 |
2.50 |
1.50 |
|
1997 |
125,363 |
3.00 |
2.00 |
1.00 |
|
1996 |
126,853 |
3.00 |
2.00 |
1.50 |
|
1995 |
108,363 |
2.50 |
1.50 |
1.00 |
|
1994 |
133,762 |
2.50 |
1.50 |
1.00 |
|
1993 |
95,504 |
2.00 |
1.00 |
0.50 |
|
1992 |
63,034 |
1.50 |
0.75 |
0.50 |
|
1991 |
63,853 |
1.50 |
0.75 |
0.50 |
|
1990 |
61,417 |
1.50 |
0.75 |
0.50 |
|
1989 |
53,353 |
1.50 |
0.75 |
0.50 |
Questions
In: Statistics and Probability
Cynthia Knott's oyster bar buys fresh Louisiana oysters for $4 per pound and sells them for $8 per pound. Any oysters not sold that day are sold to her cousin, who has a nearby grocery store, for $2 per pound. Cynthia believes that demand follows the normal distribution, with a mean of 120 pounds and a standard deviation of 10 pounds. How many pounds should she order each day? Refer to the standard normal table for z-values.
Cynthia should order nothing_______________pounds of oysters each day (round your response to one decimal place).
Z
0.00
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08
0.09
0.0
0.5000
0.5040
0.5080
0.5120
0.5160
0.5199
0.5239
0.5279
0.5319
0.5359
0.1
0.5398
0.5438
0.5478
0.5517
0.5557
0.5596
0.5636
0.5675
0.5714
0.5754
0.2
0.5793
0.5832
0.5871
0.5910
0.5948
0.5987
0.6026
0.6064
0.6103
0.6141
0.3
0.6179
0.6217
0.6255
0.6293
0.6331
0.6368
0.6406
0.6443
0.6480
0.6517
0.4
0.6554
0.6591
0.6628
0.6664
0.6700
0.6736
0.6772
0.6808
0.6844
0.6879
0.5
0.6915
0.6950
0.6985
0.7019
0.7054
0.7088
0.7123
0.7157
0.7190
0.7224
0.6
0.7258
0.7291
0.7324
0.7357
0.7389
0.7422
0.7454
0.7486
0.7518
0.7549
0.7
0.7580
0.7612
0.7642
0.7673
0.7704
0.7734
0.7764
0.7794
0.7823
0.7852
0.8
0.7881
0.7910
0.7939
0.7967
0.7996
0.8023
0.8051
0.8079
0.8106
0.8133
0.9
0.8159
0.8186
0.8212
0.8238
0.8264
0.8289
0.8315
0.8340
0.8365
0.8389
1.0
0.8413
0.8438
0.8461
0.8485
0.8508
0.8531
0.8554
0.8577
0.8599
0.8621
1.1
0.8643
0.8665
0.8686
0.8708
0.8729
0.8749
0.8770
0.8790
0.8810
0.8830
1.2
0.8849
0.8869
0.8888
0.8907
0.8925
0.8944
0.8962
0.8980
0.8997
0.9015
1.3
0.9032
0.9049
0.9066
0.9082
0.9099
0.9115
0.9131
0.9147
0.9162
0.9177
1.4
0.9192
0.9207
0.9222
0.9236
0.9251
0.9265
0.9279
0.9292
0.9306
0.9319
1.5
0.9332
0.9345
0.9357
0.9370
0.9382
0.9394
0.9406
0.9418
0.9430
0.9441
1.6
0.9452
0.9463
0.9474
0.9485
0.9495
0.9505
0.9515
0.9525
0.9535
0.9545
1.7
0.9554
0.9564
0.9573
0.9582
0.9591
0.9599
0.9608
0.9616
0.9625
0.9633
1.8
0.9641
0.9649
0.9656
0.9664
0.9671
0.9678
0.9686
0.9693
0.9700
0.9706
1.9
0.9713
0.9719
0.9726
0.9732
0.9738
0.9744
0.9750
0.9756
0.9762
0.9767
2.0
0.9773
0.9778
0.9783
0.9788
0.9793
0.9798
0.9803
0.9808
0.9812
0.9817
2.1
0.9821
0.9826
0.9830
0.9834
0.9838
0.9842
0.9846
0.9850
0.9854
0.9857
2.2
0.9861
0.9865
0.9868
0.9871
0.9875
0.9878
0.9881
0.9884
0.9887
0.9890
2.3
0.9893
0.9896
0.9898
0.9901
0.9904
0.9906
0.9909
0.9911
0.9913
0.9916
2.4
0.9918
0.9920
0.9922
0.9925
0.9927
0.9929
0.9931
0.9932
0.9934
0.9936
2.5
0.9938
0.9940
0.9941
0.9943
0.9945
0.9946
0.9948
0.9949
0.9951
0.9952
2.6
0.9953
0.9955
0.9956
0.9957
0.9959
0.9960
0.9961
0.9962
0.9963
0.9964
2.7
0.9965
0.9966
0.9967
0.9968
0.9969
0.9970
0.9971
0.9972
0.9973
0.9974
2.8
0.9974
0.9975
0.9976
0.9977
0.9977
0.9978
0.9979
0.9980
0.9980
0.9981
2.9
0.9981
0.9982
0.9983
0.9983
0.9984
0.9984
0.9985
0.9985
0.9986
0.9986
3.0
0.9987
0.9987
0.9987
0.9988
0.9988
0.9989
0.9990
0.9989
0.9990
0.9990
In: Statistics and Probability
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,
initial-scale=1.0">
<title>Weather App </title>
<link rel="stylesheet" href="main.css" />
</head>
<body>
<div class="app-wrap">
<header>
<input type="text" autocomplete="on" class="search-box"
placeholder="Enter your location..." />
</header>
<main>
<section class= "location">
<div class="city">Hyderabad, IN</div>
<div class="date">Thursday 23 July 2020</div>
</section>
<div class="current">
<div
class="temp">25<span>°c</span></div>
<div class="weather">Rainy</div>
<div class="hi-low">20°c / 23°c</div>
</div>
</main>
</div>
<script src="main.js"></script>
</body>
</html>
MAIN.js
const api = {
key="091ff564240e0e16c46ae680b188ca3e"
base: "https://api.openweathermap.org/data/2.5"
};
const searchbox = document.querySelector(".search-box");
searchbox.addEventListener("keypress", setQuery);
function setQuery(evt) {
if (evt.keyCode == 13) {
getResults(searchbox.value);
}
}
function getResults(query) {
fetch(`${api.base}weather?q=${query}&units=metric&APPID=${api.key}`)
.then((weather) => {
return weather.json();
})
.then(displayResults);
}
function displayResults(weather) {
let city = document.querySelector(".location .city");
city.innerText = `${weather.name}, ${weather.sys.country}`;
let now = new Date();
let date = document.querySelector(".location .date");
date.innerText = dateBuilder(now);
let temp = document.querySelector(".current .temp");
temp.innerHTML =
`${Math.round(weather.main.temp)}<span>°c</span>`;
let weather_el = document.querySelector(".current
.weather");
weather_el.innerText = weather.weather[0].main;
let hilow = document.querySelector(".hi-low");
hilow.innerText = `${Math.round(weather.main.temp_min)}°c /
${Math.round(
weather.main.temp_max
)}°c`;
}
function dateBuilder(d) {
let months = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
];
let days = [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
];
let day = days[d.getDay()];
let date = d.getDate();
let month = months[d.getMonth()];
let year = d.getFullYear();
return `${day} ${date} ${month} ${year}`;
}
main.css
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: "montserrat", sans-serif;
background-image: url("bg1.gif");
background-size: cover;
background-position: top center;
}
.app-wrap {
display: flex;
flex-direction: column;
min-height: 100vh;
background-image: linear-gradient(
to bottom,
rgba(0, 0, 0, 0.9),
rgba(0, 0, 0, 0.1)
);
}
header {
display: flex;
justify-content: center;
align-items: center;
padding: 50px 15px 15px;
}
header input {
width: 100%;
max-width: 280px;
padding: 10px 15px;
border: none;
outline: none;
background-color: rgba(59, 104, 85, 0.3);
border-radius: 0px 16px 0 16px;
border-bottom: 3px solid rgb(31, 56, 31);
color: #fff;
font-size: 25px;
font-weight: 500;
text-align: center;
transition: 0.2s ease-out;
}
header input:focus {
background-color: rgba(255, 255, 255, 0.6);
}
main{
flex: 1 1 100%;
padding: 25px 25px 50px;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}
.location .city {
color: #fff;
font-size: 32px;
font-weight: 500;
margin-bottom: 5px;
}
.location .date{
color: #fff;
font-size: 16px;
}
.current .temp{
color: #fff;
font-size: 102px;
font-weight: 700;
margin: 30px 0;
text-shadow: 2px 5px rgba(0, 0 ,0 , 0.5);
}
.current .temp .span{
font-weight: 500;
}
.current .weather {
color: #fff;
font-size: 32px;
font-weight: 700;
font-style: italic;
margin-bottom: 15px;
text-shadow: 0px 3px rgba(0,0,0,0.4);
}
.current .hi-low{
color: #fff;
font-size: 24px;
font-weight: 500;
text-shadow: 0px 4px rgba(0,0,0,0.4);
}
THis is a code for weatherapi. i tried to put in my api key and the url. but when i tried to search a location it wont work i dont know what i did wrong. can some one please help me out
In: Computer Science
Allow the user to enter the number of people in the party. Calculate and display the amount owed by each person if the bill were to be split evenly among the party members.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mdc.tippcalcula">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
-------------------------------
<?xml version="1.0" encoding="utf-8"?>
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:columnCount="2"
android:useDefaultMargins="true"
tools:context=".MainActivity">
<EditText
android:id="@+id/amountEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:hint=""
android:digits="0123456789"
android:inputType="number"
android:layout_column="0"
android:layout_columnSpan="2"
android:maxLength="6"/>
<TextView
android:id="@+id/amountTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_row="0"
android:layout_column="0"
android:layout_columnSpan="2"
android:layout_gravity="fill_horizontal"
android:background="@color/amount_background"
android:elevation="@dimen/elevation"
android:hint="@string/enter_amount"
android:padding="@dimen/textview_padding"
/>
<TextView
android:id="@+id/percentTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|end"
android:text="@string/tip_percentage" />
<SeekBar
android:id="@+id/percentSeekBar"
android:layout_width="wrap_content"
android:layout_height="@dimen/seekbar_height"
android:layout_gravity="fill_horizontal"
android:max="30"
android:progress="15"/>
<TextView
android:id="@+id/TipLabelTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:text="@string/tip" />
<TextView
android:id="@+id/tipTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="fill_horizontal"
android:background="@color/result_background"
android:elevation="@dimen/elevation"
android:gravity="center"
android:padding="@dimen/textview_padding" />
<TextView
android:id="@+id/totalLabelTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:text="@string/total" />
<TextView
android:id="@+id/totalTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="fill_horizontal"
android:background="@color/result_background"
android:elevation="@dimen/elevation"
android:gravity="center"
android:padding="@dimen/textview_padding"
/>
<EditText
android:id="@+id/numberOfPeopleEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="fill_horizontal"
android:background="@color/result_background"
android:elevation="@dimen/elevation"
android:gravity="center"
android:padding="@dimen/textview_padding"
android:ems="10"
android:hint="Enter Number Of People"
android:digits="012345678"
android:inputType="number"
android:layout_columnSpan="2"/>
<TextView
android:id="@+id/eachPersonLabelTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:text="@string/each" />
<TextView
android:id="@+id/eachPersonTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="fill_horizontal"
android:background="@color/result_background"
android:elevation="@dimen/elevation"
android:gravity="center"
android:padding="@dimen/textview_padding"
/>
</GridLayout>
----------
package com.mdc.tippcalcula;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.TextView;
import java.text.NumberFormat;
public class MainActivity extends AppCompatActivity {
private static final NumberFormat currencyFormat = NumberFormat.getCurrencyInstance();
private static final NumberFormat percentFormat = NumberFormat.getCurrencyInstance();
private double billAmount = 0.0;
private double percent = 0.15;
private double numPeople = 0;
private TextView percentTextView;
private TextView tipTextView;
private TextView amountTextView;
private TextView totalTextView;
private TextView eachPersonTextView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
amountTextView = (TextView) findViewById (R.id.amountTextView);
percentTextView = (TextView) findViewById (R.id.percentTextView);
tipTextView = (TextView) findViewById(R.id.tipTextView);
totalTextView = (TextView) findViewById(R.id.totalTextView);
eachPersonTextView = (TextView) findViewById(R.id.eachPersonTextView);
tipTextView.setText(currencyFormat.format(0));
totalTextView.setText(currencyFormat.format(0));
eachPersonTextView.setText(currencyFormat.format(0));
EditText amountEditText = (EditText) findViewById(R.id.amountEditText);
amountEditText.addTextChangedListener(amountEditTextWatcher);
SeekBar percentSeekBar = (SeekBar) findViewById(R.id.percentSeekBar);
percentSeekBar.setOnSeekBarChangeListener(seekBarListener);
}
private void calculate(){
percentTextView.setText(percentFormat.format(percent));
double tip = billAmount * percent;
double total = billAmount + tip;
tipTextView.setText(currencyFormat.format(tip));
totalTextView.setText((currencyFormat.format(total)));
}
private final OnSeekBarChangeListener seekBarListener = new OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean b)
{
percent = progress / 100.0;
calculate();
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
};
private final TextWatcher amountEditTextWatcher = new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2)
{
try {
billAmount = Double.parseDouble(charSequence.toString()) / 100.0;
amountTextView.setText(currencyFormat.format(billAmount));
}
catch (NumberFormatException e){
amountTextView.setText("");
billAmount = 0.0;
}
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) { }
@Override
public void afterTextChanged(Editable editable) { }
};
}
------
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="textview_padding">12dp</dimen>
<dimen name="elevation">4dp</dimen>
<dimen name="seekbar_height">40dp</dimen>
</resources>
---
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#6200EE</color>
<color name="colorPrimaryDark">#3700B3</color>
<color name="colorAccent">#03DAC5</color>
<color name="amount_background">#BBDEFB</color>
<color name="result_background">#ffE0B2</color>
</resources>
----
<resources>
<string name="app_name">Tip Calculator</string>
<string name="enter_amount"> Enter Amount</string>
<string name="tip_percentage">15%</string>
<string name="tip">Tip</string>
<string name="total">Total</string>
<string name="number">No. Of People</string>
<string name="each">Each Person</string>
</resources>In: Computer Science