All Code should be written in C:
1. A perfect number is defined as a number whose proper divisors
(factors not including the number itself) add up to the same
number. For example, 28 is a perfect number because its perfect
divisors are 1, 2, 4, 7, 14, which add up to 28. Write a C function
called is_perfect that takes a since integer as input, and returns
1 if the number is perfect, or 0 otherwise.
2. Using the function you wrote in Q1, write a C program to print
out all the perfect numbers between 1 and 10000. There are only 4
such numbers, the largest being 8128.
3. Write your own version of the strcpy() function, called mystrcpy(). This function should take two strings (char pointers) as input, and copy the second string into the first. Test that your function works properly.
4. Write a C function called strdelete() which takes a string (char pointer) and a character as input. The function should then remove any instance of the character from the string. This should be done by shifting all the other characters down one position in the array so the string becomes shorter. For example strdelete("hello world", 'o') will result in the string being "hell wrld".
In: Computer Science
//Java Language
Read an integer number from the user. If the number is not positive, change its sign.
1 Count the digits of the number
2 Count the odd digits of the number
3 Calculate the sum of the digit values of the
number
In: Computer Science
Please answer broadly:
1. If you reduce the number of Kanbans, the number of WIP in production system will be reduced accordingly. If you reduce the number of Kanbans excessively what are the possible consequences?
2. What are the typical approaches to shorten the production lead time?
3. What are the potential benefits of production smoothing for auto-makers and their suppliers ?
In: Operations Management
File has a format Name and number, the number represents power. The name and the (integer) power are separated by some amount of space. Importantly, any line that begins with a hash '#' are comments and they need to be ingored. Write a program that reads from that file, and prints out only the name of the hero with the strongest power. That name should be capitalized (not uppercase, but capitalized, as in 'Galadriel')
Here is the heroes.txt
# DC heroes
# format: "name" "power"
# 57
# 83
hal 12
batman 48
grayson 14
cyclone 24
superman 38
luthor 15
joker 18
drake 33
wayne 42
rayner 18
# below heroes are additional heroes
arrow 22
kord 48
batwoman 37
supergirl 49
stargirl 24
darkseid 41
gardner 28
pennyworth 27
west 12
aquaman 47
kallor 45
arisia 36
What i have so far:
fn = open('heroes.txt')
count = 0
for z in fn:
line = z.strip()
if not '#' in line:
print(line.capitalize())
continue
po1 = line.find()
print(po1)
fn.close
In: Computer Science
30)A pianist plans to play 6 pieces at a recital from her
repertoire of 27 pieces, and is carefully considering which song to
play first, second, etc. to create a good flow. How many different
recital programs are possible?
31)Suppose a designer has a palette of 9 colors to work with, and
wants to design a flag with 2 vertical stripes, all of different
colors.
How many possible flags can be created?
32)From a group of 8 people, you randomly select 5 of them.
What is the probability that they are the 5 oldest people in the
group?
Give your answer as a fraction
33)You pick 6 digits (0-9) at random without replacement, and write
them in the order picked.
What is the probability that you have written the first 6 digits of
your phone number? Assume there are no repeats of digits in your
phone number.
Give your answer as a fraction.
36)A girl has 7 skirts, 10 blouses, and 4 pairs of shoes. How many
different skirt-blouse-shoe outfits can she wear? (Assume that each
item matches all the others, so she is willing to wear any
combination.)
Your answer is
37)Standard automobile license plates in a country display 2
numbers, followed by 2 letters, followed by 3 numbers. How many
different standard plates are possible in this system? (Assume
repetitions of letters and numbers are allowed.)
Your answer is
38)A true-false test contains 21 questions. In how many different
ways can this test be completed. (Assume we don't care about our
scores.)
Your answer is
39)How many three-letter "words" can be made from 9 letters
"FGHIJKLMN" if repetition of letters
(a) is allowed?
Your answer is :
(b) is not allowed?
Your answer is
40)In how many ways can first, second, and third prizes be awarded
in a contest with 245 contestants?
Your answer is
41)Find the number of distinguishable permutations of the given
letters "AAABBBCC".
Your answer is
In: Statistics and Probability
The Book Publishing industry in Australia
20% of books are sold via independent retailers that tend to specialize in a particular genre or prefer unusual (not mainstream) books
70% of books are sold via large retail chains that only deal in mainstream books published by large or long-established publishers who also provide promotional dollars to support their books
10% of books are sold via the internet (e.g. Amazon) and this is expected to dramatically increase as they increasingly capture the time-poor or budget-conscious market segments
Book sales have been fairly stable in this mature industry, however they are expected to decline in the future as internet and cable-TV usage increases
Australia has one of the highest per capita magazine sales in the world
There has been a dramatic increase in self-publishing over the past 10 years, however these books are typically not accepted by retailers and tend to have print runs of less than 1,000
E-books would be in the early growth phase of their product life cycle. They currently have relatively low sales but are expected to steadily increase over time
There is an increased number of authors in the marketplace, appearing to be driven by easy access to research material (via the internet) and by the increasing popularity of blogs
Despite more authors available, there is only a small number of “brand” authors (such as Bryce Courtney) who can attract significant book sales on their name alone
Excluding self-published books, there are around 500 new books available in the Australian market each month (including books published internationally)
There is an increasing number of large book publishers, as the larger ones battle for market share by acquiring smaller publishing houses
QUESTIONS
Assess the book publishing industry using Porter’s Five-forces model.
What key insights have you gained by assessing this industry using this structured model?
Therefore, what is your overall assessment of the attractiveness of the industry?
How could a firm use Porter’s Five-forces model in their strategy and planning activities?
In: Accounting
G&G Furniture Co. produces chairs and tables. The following table gives the profit generated per unit, as well as the amount of wood, labor and other materials required, per unit of each product along with their maximum monthly limits in terms of availability.
| Chairs | Tables | Max Limits | |
| profit | $100 | $125 | |
| Wood | 20 lbs per unit | 30 lbs per unit | 6000 lbs |
| Other Materials | 1 lbs per unit | 1 lbs per unit | 400 lbs |
| Labor | 1.5 hours per unit | 2 hours per unit | 300 hours |
In addition to the above, you are told that the number of Chairs produced must not be more than 100 units greater than the number of Tables produced. Lastly, you are told that any linear programming solution cannot give non-integer values for the number of Tables and Chairs to be produced.
2 Given that G&G Furniture Co. wants to earn the highest possible profits without violating these constraints, help the company decide how many tables and chairs to produce by answering the following questions:
a) Clearly list down the decision variables, the objective function and the constraints in words. You will be marked for the clarity of your definition of these parameters as well the use of the standard verbal (Step 1) format for these parameters outlined in your textbook (and in class).
b) Clearly provide the mathematical expressions, equations and inequalities for the objective function and the constraints in the summary (Step 2) format prescribed in your textbook (and in class).
c) Formulate the mathematical linear programming model for this problem using Microsoft Excel and use Microsoft Excel Solver Add-in to solve the problem. You will be marked for clarity of formatting and labelling and using the Excel setup correctly.
d) How many of each type of product do you recommend G&G Furniture Co. should produce per month to optimize their level of profit? e) What would be the profit at this level?
In: Statistics and Probability
Qualitative Predictions about Entropy Entropy is the randomness of a system. At the molecular level, entropy can be described in terms of the possible number of different arrangements of particle positions and energies, called microstates. The more microstates the system has, the greater its entropy. Microstates depend on molecular motion. Molecules may undergo three different types of motion: translational motion, vibrational motion, and rotational motion. During translational motion, the entire molecule moves in one direction. During vibrational motion, atoms in a molecule move toward and away from one another. During rotational motion, molecules rotate or spin. The number of molecules, the space available for the molecules, and the energy available to the molecules will impact the number of microstates. Another way of looking at entropy is that the universe is moving toward a broader distribution of energy. The universe has a constant amount of energy as stated in the first law of thermodynamics. The universe started with low entropy (concentrated in the moment before the "big bang") and the entropy has since been constantly increasing by distributing this energy. Heat distribution from high temperature to low temperature is a another example of this phenomenon. Part A Rank these systems in order of decreasing entropy. Rank from highest to lowest entropy. To rank items as equivalent, overlap them. Hints HelpReset Least entropyGreatest entropy 1 mol of neon gas at 273 K and 40 L 1 mol of chlorine gas at 273 K and 40 L 1 mol of hydrogen peroxide gas at 273 K and 40 L 1 mol of neon gas at 273 K and 20 L 1/2 mol of neon gas at 273 K and 20 L 1/2 mol of neon gas at 100 K and 20 L 1/2 mol of liquid neon at 100 K The correct ranking cannot be determined. SubmitMy AnswersGive Up Incorrect; Try Again; 4 attempts r
In: Chemistry
Suppose a geyser has a mean time between eruptions of
75 minutes
.
If the interval of time between the eruptions is normally distributed with standard deviation
19 minutes
,
answer the following questions.
(a) What is the probability that a randomly selected time interval between eruptions is longer than
84
minutes?
The probability that a randomly selected time interval is longer than
84
minutes is approximately
nothing
.
(Round to four decimal places as needed.)
(b) What is the probability that a random sample of
10
time intervals between eruptions has a mean longer than
84
minutes?
The probability that the mean of a random sample of
10
time intervals is more than
84
minutes is approximately
nothing
.
(Round to four decimal places as needed.)
(c) What is the probability that a random sample of
19
time intervals between eruptions has a mean longer than
84
minutes?
The probability that the mean of a random sample of
19
time intervals is more than
84
minutes is approximately
nothing
.
(Round to four decimal places as needed.)
(d) What effect does increasing the sample size have on the probability? Provide an explanation for this result. Choose the correct answer below.
A.
The probability decreases because the variability in the sample mean increases as the sample size increases.
B.
The probability increases because the variability in the sample mean decreases as the sample size increases.
C.
The probability increases because the variability in the sample mean increases as the sample size increases.
D.
The probability decreases because the variability in the sample mean decreases as the sample size increases.
(e) What might you conclude if a random sample of
19
time intervals between eruptions has a mean longer than
84
minutes? Choose the best answer below.
A.
The population mean must be less than 75 comma since the probability is so low.
B.
The population mean may be greater than 75.
C.
The population mean is
75
minutes, and this is an example of a typical sampling.
D.
The population mean cannot be 75 comma since the probability is so low.
In: Statistics and Probability
Consider the probability that no more than 49 out of 140 students will graduate on time. Assume the probability that a given student will graduate on time is 64%.
Specify whether the normal curve can be used as an approximation to the binomial probability by verifying the necessary conditions.
In: Statistics and Probability