Answer:
#include <iostream>
#iclude <iomanip>
#include <algorithm>
using namespace std;
int main(){
int num1, num2, num3,
int sum, maxDrop, minDrop = 0;
float avg;
string end = "\n";
cout << " Enter the leaf drop for September: ";
cin >> num1 >> endl = end;
cout << "Enter the leaf drop for October: ";
cin >> num2 >> endl = end;
cout << "Enter the leaf drop for November: ";
cin >> num3 >> endl = end;
int numbers[3] = {num1, num2, num3} ;
string month[3] = { "September", "October", "November"}
for ( int i =0; i < 3; i++) {
if (numbers[i] < 0) {
cout << "Error: all leaf counts must be at least zero\n";
cout << "End of Maple Marvels\n";
cout << "Welcome to Maple Marvels";
break;
} else if (number[i] >= 0 ) {
sum += number[i] ;
}
}
for (int i = 0; i < 3; i++){
cout << month[i] << " leaf drop: " << numbers[i] << endl = end;
}
cout << "Total drop: " << sum << endl = end;
cout << setprecision(3) << fixed;
cout << "Average drop: " << sum / 3<< endl = end;
maxDrop = max( num1, num2, num3);
minDrop = min(num1, num2, num3);
int n = sizeof(numbers)/sizeof(numbers[0]);
auto itr = find(number, number + n, maxDrop);
cout << "Highest drop: "<< month[ distance(numbers, itr) ] << endl = end;
auto itr1 = find(number, number + n, minDrop);
cout << "Lowest drop: " << month[ distance(numbers, itr1) ] << endl = end;
cout << "End of Maple Marvels";
Explanation:
The C++ soucre code above receives three integer user input and calculates the total number, average, minimum and maximum number of leaf drop per month, if the input isn't less than zero.
1.2
Is media a curse or a blessing? Explain.
Answer:
i think its both because if there is misunderstanding between media and government then the media distroys the government and if there us no misunderstanding between media and government and if it goes smoothly then its like a blessing for government
Answer:
Media is a blessing...a curse as well when it's misguiding the world and hiding the real sinner and juxtaposing the culprit as the saviour
Earned value:
How is it calculated?
What does the measurement tell you?
Answer:
Earned value is a measure which is used on projects to determine the value of work which has been completed to date, in order to understand how the project is performing on a cost and schedule basis. At the beginning of a project, a project manager or company will determine their budget at completion (BAC) or planned value (PV).
Explanation:
For this lab you will do 2 things:
Solve the problem in an algorithm
Code it in Python
Problem:
Cookie Calories
A bag of cookies holds 40 cookies. The calorie information on the bag claims that there are 10 "servings" in the bag and that a serving equals 300 calories. Write a program that asks the user to input how many cookies he or she ate and the reports how many total calories were consumed.
*You MUST use constants to represent the number of cookies in the bag, number of servings, and number of calories per serving. Remember to put constants in all caps!
Make sure to declare and initialize all variables before using them!
Then you can do the math using those constants to find the number of calories in each cookie.
Make this program your own by personalizing the introduction and output.
Sample Output:
WELCOME TO THE CALORIE COUNTER!!
Answer:
Here is the Python program:
COOKIES_PER_BAG = 40 #sets constant value for bag of cookies
SERVINGS_PER_BAG = 10 #sets constant value for serving in bag
CALORIES_PER_SERVING = 300 #sets constant value servings per bag
cookies = int(input("How many cookies did you eat? ")) #prompts user to input how many cookies he or she ate
totalCalories = cookies * (CALORIES_PER_SERVING / (COOKIES_PER_BAG / SERVINGS_PER_BAG)); #computes total calories consumed by user
print("Total calories consumed:",totalCalories) #displays the computed value of totalCalories consumed
Explanation:
The algorithm is:
StartDeclare constants COOKIES_PER_BAG, SERVINGS_PER_BAG and CALORIES_PER_SERVINGSet COOKIES_PER_BAG to 40Set SERVINGS_PER_BAG to 10Set CALORIES_PER_SERVING to 300Input cookiesCalculate totalCalories: totalCalories ← cookies * (CALORIES_PER_SERVING / (COOKIES_PER_BAG / SERVINGS_PER_BAG))Display totalCaloriesI will explain the program with an example:
Lets say user enters 5 as cookies he or she ate so
cookies = 5
Now total calories are computed as:
totalCalories = cookies * (CALORIES_PER_SERVING / (COOKIES_PER_BAG / SERVINGS_PER_BAG));
This becomes:
totalCalories = 5 * (300/40/10)
totalCalories = 5 * (300/4)
totalCalories = 5 * 75
totalCalories = 375
The screenshot of program along with its output is attached.
To write a letter using Word Online, which document layout should you choose? ASAP PLZ!
Traditional... See image below
Answer: new blank document
Explanation: trust is key
Write a function that takes as input two parameters: The first parameter is a positive integer representing a base that is guaranteed to be greater than 1. The second parameter is an integer representing a limit. The function should return a list containing all of the non-negative powers of the base less than the limit (not including the limit). The powers should start at base^0=1 and increase from there until the limit. If the limit is less than 1 the functions should just return an empty list
Answer:
Written in Python:
def powerss(base, limit):
outputlist = []
i = 1
output = base ** i
while limit >= output:
outputlist.append(output)
i = i + 1
output = base ** i
return(outputlist)
Explanation:
This declares the function
def powerss(base, limit):
This creates an empty list for the output list
outputlist = []
This initializes a counter variable i to 1
i = 0
This calculates base^0
output = base ** i
The following iteration checks if limit has not be reached
while limit >= output:
This appends items to the list
outputlist.append(output)
The counter i is increased here
i = i + 1
This calculates elements of the list
output = base ** i
This returns the output list
return(outputlist)
Write (define) a function named count_down_from, that takes a single argument and returns no value. You can safely assume that the argument will always be a positive integer. When this function is called, it should print a count from the argument value down to 0.
Examples: count_down_from(5) will print 5,4,3,2,1,0, count_down_from(3) will print 3,2,1,0, count_down_from(1) will print 1,0,
Answer:
Written in Python
def count_down_from(n):
for i in range(n,-1,-1):
print(i)
Explanation:
This line defines the function
def count_down_from(n):
This line iterates from n to 0
for i in range(n,-1,-1):
This line prints the countdown
print(i)
Complete the following sentences using the drop-down menus.
is considered by some to be the most important program because of its popularity and wide use.
applications are used to display slide show-style presentations.
programs have revolutionized the accounting industry.
Answer:
is considered by some to be the most important program because of its popularity and wide use.
✔ Presentation
applications are used to display slide show-style presentations.
✔ Spreadsheet
programs have revolutionized the accounting industry.
Explanation:
just did it on edg this is all correct trust
the answers are:
- presentation
- spreadsheet
Tasha works as an information technologist for a company that has offices in New York, London, and Paris. She is based out of the New York office and uses the web to contact the London and Paris office. Her boss typically wants her to interact with customers and to run training seminars to teach employees new software and processes. Which career pathway would have this type of employee?
Answer:
D. Interactive Media
Explanation:
i just took the test right now
The career pathway which would have this type of employee is an interactive media.
What is media?Media is a terminology that is used to describe an institution that is established and saddled with the responsibility of serving as a source for credible, factual and reliable news information to its audience within a geographical location, either through an online or print medium.
In this context, an interactive media is a form of media that avail all media personnels an ability to easily and effectively interact with their customers or audience.
Read more on media here: https://brainly.com/question/16606168
Alice just wrote a new app using Python. She tested her code and noticed some of her lines of code are out of order. Which principal of programing should Alice review?
Answer:
sequencing
Explanation:
from flvs
Answer:
Sequencing
Explanation:
Type the correct answer in the box
in which phishing technique are URLs of the spoofed organization misspelled?
anon
is a phishing technique in which URLs of the spoofed organization are misspelled
Answer: Link manipulation
Explanation:
Answer:
Typo Squatting
Explanation:
The hide/unhide feature only hides in the
_____ view?
Answer: main...?
Explanation:
which of the following uses technical and artistic skills to create visual products that communicate information to an audience? ○computer engineer ○typography ○computer animator ○graphic designer
Answer:
grafic desiner
Explanation:
just a guess lol
Answer:
I don't know...
Explanation:
D
Use the drop-down menus to explain how to personalize a letter.
1. Place the cursor where the name and address should appear.
2. Select
v in the mail merge wizard.
3. Select the name and address format and
if needed to link the correct data to the field.
4. Place the cursor below the address block, and select
from the mail merge wizard.
5. Select the greeting line format and click
Explanation:
Address block
Match Fields
Greeting Line
Ok
Place the cursor where the name and address should appear: This step is important as it identifies the exact location where the personalized information should be placed in the letter.
What is personalization?Personalization refers to the process of customizing a communication, such as a letter or email, to make it more individualized and relevant to the recipient.
To explain how to personalize a letter:
Place the cursor where you want the name and address to appear: This step is critical because it determines where the personalised information should be placed in the letter.
In the mail merge wizard, enter v: This step involves selecting the mail merge feature in the word processor software. The mail merge feature is typically represented by the "v" symbol.
Choose the name and address format, and then [link] to link the correct data to the field: This step entails selecting the appropriate name and address format, such as "First Name," "Last Name," and "Address Line 1." It also entails connecting the data source (for example, a spreadsheet or database) to the relevant fields in the letter.
Place the cursor below the address block and use the mail merge wizard to select [Insert Greeting Line]: This step involves deciding where to place the greeting line in the letter, which is usually below the address block. The mail merge wizard offers formatting options for the greeting line based on the data source.
Choose the greeting line format and press [OK]: This step entails deciding on a greeting line format, such as "Dear [First Name]" or "Hello [Full Name]." Once the format is chosen, the user can finish personalising the letter by clicking "OK."
Thus, this can be concluded regarding the given scenario.
For more details regarding personalization, visit:
https://brainly.com/question/14514150
#SPJ2
Which situation best illustrates how traditional economies meet their citizens needs for employment and income
APEX!!
A. A parent teaches a child to farm using centuries old techniques.
B. A religious organization selects a young person to become a priest
C. A government agency assigns a laborer a job working in a factory
D. A corporation hires an engineer who has just graduated from college
The situation that best show how traditional economies meet their citizens needs for employment and income is that a parent teaches a child to farm using centuries old techniques.
What is a traditional economy about?A traditional economy is known to be a type of system that depends on customs, history, and time framed/honored beliefs.
Tradition is know to be the guide that help in economic decisions such as production and distribution. Regions with traditional economies are known to depend on agriculture, fishing, hunting, etc.
Learn more about traditional economies from
https://brainly.com/question/620306
what is a computer ?it types
Answer:
A computer is a digital device that you can do things on such as play games, research something, do homework.
Explanation:
Answer:
A computer can be best described as an electronic device that works under the control of information stored in it's memory.
There are also types of computers which are;
Microcomputers/personal computerMini computersMainframe computerssuper computersWhat does the measurement tell you?
Schedule performance index
Answer:
how close the project is to being completed compared to the schedule/ how far ahead or behind schedule the project is, relative to the overall project
Explanation:
Your program is going to compare the distinct salaries of two individuals for the last 5 years. If the salary for the two individual for a particular year is exactly the same, you should print an error and make the user enter both the salaries again for that year. (The condition is that there salaries should not be the exact same).Your program should accept from the user the salaries for each individual one year at a time. When the user is finished entering the salaries, the program should print which individual made the highest total salary over the 5 year period. This is the individual whose salary is the highest.You have to use arrays and loops in this assignment.In the sample output examples, what the user entered is shownin italics.Welcome to the winning card program.
Enter the salary individual 1 got in year 1>10000
Enter the salary individual 2 got in year 1 >50000
Enter the salary individual 1 got in year 2 >30000
Enter the salary individual 2 got in year 2 >50000
Enter the salary individual 1 got in year 3>35000
Enter the salary individual 2 got in year 3 >105000
Enter the salary individual 1 got in year 4>85000
Enter the salary individual 2 got in year 4 >68000
Enter the salary individual 1 got in year 5>75000
Enter the salary individual 2 got in year 5 >100000
Individual 2 has the highest salary
In python:
i = 1
lst1 = ([])
lst2 = ([])
while i <= 5:
person1 = int(input("Enter the salary individual 1 got in year {}".format(i)))
person2 = int(input("Enter the salary individual 1 got in year {}".format(i)))
lst1.append(person1)
lst2.append(person2)
i += 1
if sum(lst1) > sum(lst2):
print("Individual 1 has the highest salary")
else:
print("Individual 2 has the highest salary")
This works correctly if the two individuals do not end up with the same salary overall.
Ms. Myers commented that _____ she slept in at the hotel was better than _____ she slept in at home.
Write a function that takes a string and return the back half of the string. If the string has an odd number of characters, include the extra character. Your solution should also work if given and empty string. Examples: back_half('abba') should return 'ba' back_half('abcba') should return 'cba'
Answer:
Written in Python
def back_half(inputstring):
outputstring = ""
lent = len(inputstring)
if lent == 0:
outputstring ="Empty String"
elif lent%2 == 0:
begin = lent/2
for i in range(int(begin),lent):
outputstring = outputstring + inputstring[i]
else:
begin = (lent+1)/2
for i in range(int(begin-1),lent):
outputstring = outputstring + inputstring[i]
return outputstring
Explanation:
This line defines the function
def back_half(inputstring):
This line initializes outputstring to an empty string
outputstring = ""
This calculates the length of the input string
lent = len(inputstring)
This checks if the length of inputstring is 0. If yes, the function returns empty string
if lent == 0:
outputstring ="Empty String"
This checks if the length of inputstring is even.
elif lent%2 == 0:
begin = lent/2 This line gets the beginning of the half string
for i in range(int(begin),lent):
outputstring = outputstring + inputstring[i] This generates the half string
else: This checks for odd length
begin = (lent+1)/2 This line gets the beginning of the half string
for i in range(int(begin-1),lent):
outputstring = outputstring + inputstring[i] This generates the half string
return outputstring This returns the outputstring
Question 8 (3 points) Which of the following is an external factor that affects the price of a product? Choose the answer.
sales salaries
marketing strategy
competition
production cost
Answer: tax
Explanation: could effect the cost of items because the tax makes the price higher
oh sorry i did not see the whole question
this is the wrong awnser
1. Write a function named problem1 to simulate the purchases in a grocery store. Write statements to read the price of each item until you enter a terminal value to end the loop. Calculate the subtotal and add a sales tax of 8.75% to the subtotal. Return the subtotal, the amount of the sales tax, and the total. Call the function and display the return results. (25 pts)
Answer:
ok
Explanation:
What is a piece of information sent to a function
Answer:
the information sent to a function is the 'input'.
or maybe not hehe
Reading for comprehension requires _____ reading?
1. passive
2. active
3. slow
4. fast
Answer:
IT is ACTIVE
Explanation: I took the quiz
Answer:
not sure sorry
Explanation:
Write a program that finds the number of items above the average of all items. The problem is to read 100 numbers, get the average of these numbers, and find the number of the items greater than the average. To be flexible for handling any number of input, we will let the user enter the number of input, rather than fixing it to 100.
Answer:
Written in Python
num = int(input("Items: "))
myitems = []
total = 0
for i in range(0, num):
item = int(input("Number: "))
myitems.append(item)
total = total + item
average = total/num
print("Average: "+str(average))
count = 0
for i in range(0,num):
if myitems[i] > average:
count = count+1
print("There are "+str(count)+" items greater than average")
Explanation:
This prompts user for number of items
num = int(input("Items: "))
This creates an empty list
myitems = []
This initializes total to 0
total = 0
The following iteration gets user input for each item and also calculates the total
for i in range(0, num):
item = int(input("Number: "))
myitems.append(item)
total = total + item
This calculates the average
average = total/num
This prints the average
print("Average: "+str(average))
This initializes count to 0
count = 0
The following iteration counts items greater than average
for i in range(0,num):
if myitems[i] > average:
count = count+1
This prints the count of items greater than average
print("There are "+str(count)+" items greater than average")
Which of the following stakeholders makes policies for a green economy?
Answer:
government is the answer
Which line will be run?
A. The first line
B. The second
line
// 10 - 8 + 3
18 + 7 + 365
C. Both
D. Neither
Answer:
The answer to this question is given below in the explanation section.
Explanation:
The give code is:
// 10 - 8 + 3
18 + 7 + 365
the given lines of code, if you run it as it is given in the question then the answer is D. Because these lines will run by the compiler but give an error because these lines are not properly written.
However, if we consider, that these lines of codes are correct then the second line will run and the first line will not run because the first line is a comment. Before the beginning of the first line, there is a "//" that shows a comment line. it is a singal line comment and the compiler will not run the comment line.
Which online text source would include a review of a new TV show?
an academic journal
a blog
an e-book
an encyclopedia
Answer:
Blog
Explanation:
Online text sources include blogs, e-books, encyclopaedias, and e-zines. As a result, options A, B, C, and D are correct.
What is a text source?A source is a book or other material that contains the data that has been used, whereas a citation is the actual statement of the starting point. They were researchers who also worked as professors, writers, and other professionals, and they published books and articles.
Online text sources are those that can be accessed from anywhere and are available on the internet. The online text shows that anyone can see or exceed including blogs, e-books, encyclopaedias, and e-zines.
These are available for further studies and research. Also to give information this can be a source. Therefore, options A, B, C, and E is the correct option.
Learn more about text sources, here:
brainly.com/question/19131568
#SPJ6
Assignment 3 chatbot edhesive
Answer:
name1=input("What is your first name? ")
name2=input("What is your last name? ")
print("Hi there, "+ name1+" "+name2 +" ,nice to meet you!")
print("How old are you?")
age = int(input(" "))
print(str(age) + " is a good age.")
if(age >= 16):
print("You are old enough to drive. \n")
else:
print("Still taking the bus, I see. \n")
print("So, " + name1 + ", how are you today?")
feel=input("")
print("You are " + feel),
if(feel== "Happy"):
print("That is good to hear.")
elif(feel == "Sad"):
print("I'm sorry to hear that. ")
else:
print("Oh my!")
print("Tell me more. \n")
next=input("")
import random
r = random.randint(1, 3)
if(r==1):
print("Sounds interesting. \n")
elif(r==2):
print("That's good to hear. \n")
else:
print("How unusual. \n")
print("Well, " + name1 + ", it has been nice chatting with you.")
Explanation:
In this exercise you will debug the code which has been provided in the starter file. The code is intended to take two strings, s1 and s2 followed by a whole number, n, as inputs from the user, then print a string made up of the first n letters of s1 and the last n letters of s2. Your job is to fix the errors in the code so it performs as expected (see the sample run for an example).
Sample run
Enter first string
sausage
Enter second string
races
Enter number of letters from each word
3
sauces
Note: you are not expected to make your code work when n is bigger than the length of either string.
1 import java.util.Scanner;
2
3 public class 02_14_Activity_one {
4 public static void main(String[] args) {
5
6 Scanner scan = Scanner(System.in);
7
8 //Get first string
9 System.out.println("Enter first string");
10 String s1 = nextLine(); 1
11
12 //Get second string
13 System.out.println("Enter second string");
14 String s2 = Scanner.nextLine();
15
16 //Get number of letters to use from each string
17 System.out.println("Enter number of letters from each word");
18 String n = scan.nextLine();
19
20 //Print start of first string and end of second string
21 System.out.println(s1.substring(1,n-1) + s2.substring(s1.length()-n));
22
23
24 }
Answer:
Here is the corrected program:
import java.util.Scanner; //to accept input from user
public class 02_14_Activity_one { //class name
public static void main(String[] args) { //start of main method
Scanner scan = new Scanner(System.in); //creates Scanner class object
System.out.println("Enter first string"); //prompts user to enter first string
String s1 = scan.nextLine(); //reads input string from user
System.out.println("Enter second string"); //prompts user to enter second string
String s2 = scan.nextLine(); //reads second input string from user
System.out.println("Enter number of letters from each word"); //enter n
int n = scan.nextInt(); //reads value of integer n from user
System.out.println(s1.substring(0,n) + s2.substring(s2.length() - n ));
} } //uses substring method to print a string made up of the first n letters of s1 and the last n letters of s2.
Explanation:
The errors were:
1.
Scanner scan = Scanner(System.in);
Here new keyword is missing to create object scan of Scanner class.
Corrected statement:
Scanner scan = new Scanner(System.in);
2.
String s1 = nextLine();
Here object scan is missing to call nextLine() method of class Scanner
Corrected statement:
String s1 = scan.nextLine();
3.
String s2 = Scanner.nextLine();
Here class is used instead of its object scan to access the method nextLine
Corrected statement:
String s2 = scan.nextLine();
4.
String n = scan.nextLine();
Here n is of type String but n is a whole number so it should be of type int. Also the method nextInt will be used to scan and accept an integer value
Corrected statement:
int n = scan.nextInt();
5.
System.out.println(s1.substring(1,n-1) + s2.substring(s1.length()-n));
This statement is also not correct
Corrected statement:
System.out.println(s1.substring(0,n) + s2.substring(s2.length() - n ));
This works as follows:
s1.substring(0,n) uses substring method to return a new string that is a substring of this s1. The substring begins at the 0th index of s1 and extends to the character at index n.
s2.substring(s2.length() - n ) uses substring method to return a new string that is a substring of this s2. The substring then uses length() method to get the length of s2 and subtracts integer n from it and thus returns the last n characters of s2.
The screenshot of program along with its output is attached.
Write a function called matches that takes two int arrays and their respective sizes, and returns the number of consecutive values that match between the two arrays starting at index 0. Suppose the two arrays are {3, 2, 5, 6, 1, 3} and {3, 2, 5, 2, 6, 1, 3} then the function should return 3 since the consecutive matches are for values 3, 2, and 5.
Answer:
Written in C++
int matches(int arr1[], int arr2[], int k) {
int count = 0;
int length = k;
for(int i =0; i<length; i++) {
if(arr1[i] == arr2[i]) {
count++;
}
}
return count;
}
Explanation:
This line defines the function
int matches(int arr1[], int arr2[], int k) {
This line initializes count to 0
int count = 0;
This line initializes length to k
int length = k;
This line iterates through the array
for(int i =0; i<length; i++) {
The following if statement checks for matches
if(arr1[i] == arr2[i]) {
count++;
}
}
This returns the number of matches
return count;
}
See attachment for complete program