Answer:
#include <iostream>
using namespace std;
int main()
{
const int NUM_ROWS = 2;
const int NUM_COLS = 2;
int milesTracker[NUM_ROWS][NUM_COLS];
int i = 0;
int j = 0;
int maxMiles = -99; // Assign with first element in milesTracker before loop
int minMiles = -99; // Assign with first element in milesTracker before loop
milesTracker[0][0] = -10;
milesTracker[0][1] = 20;
milesTracker[1][0] = 30;
milesTracker[1][1] = 40;
maxMiles = milesTracker[0][0];
minMiles = milesTracker[0][0];
for (i = 0; i < NUM_ROWS; i++){
for (j = 0; j < NUM_COLS; j++){
if (milesTracker[i][j] > maxMiles){
maxMiles = milesTracker[i][j];
}
if (milesTracker[i][j] < minMiles){
minMiles = milesTracker[i][j];
}
}
}
cout << "Min: " << minMiles << endl;
cout << "Max: " << maxMiles << endl;
return 0;
}
Explanation:
It seems you want to find the min and max value in the array. Let me go through what I added to your code.
Set the maxMiles and minMiles as the first element in milesTracker
Create a nested for loop that iterates through the milesTracker. Inside the loop, check if an element is greater than maxMiles, set it as maxMiles. If an element is smaller than minMiles, set it as minMiles.
When the loop is done, print the minMiles and maxMiles
programmning You are asked to develop a cash register for a fruit shop that sells oranges and apples. The program will first ask the number of customers. Subsequently, for each customer, it will ask the name of the customer and the number of oranges and apples they would like to buy. And then print a summary of what they bought along with the bill as illustrated in the session below: How many customers? 2 Name of Customer 1 Harry Oranges are $1.40 each. How many Oranges? 1 Apples are $.75 each. How many Apples? 2 Harry, you bought 1 Orange(s) and 2 Apple(s). Your bill is $2.9 Name of Customer 2 Sandy Oranges are $1.40 each. How many Oranges? 10 Apples are $.75 each. How many Apples? 4 Sandy, you bought 10 Orange(s) and 4 Apple(s). Your bill is $17.0
Solution:
def main():
n=int(input("How many customers? "))
print()
# User input of the fruit requirement of all customers.
for i in range(n):
print("Name of Customer",i+1)
name = input()
print("Oranges are $1.40 each. How many Oranges?")
no_of_orange = int(input())
print("Apples are $.75 each. How many Apples?")
no_of_apple = int(input())
print(name,", you bought",no_of_orange,"Orange(s) and",no_of_apple,"Apple(s).")
# Calculation of total bill
total_bill = (no_of_orange*1.40) + (no_of_apple*0.75);
#Print total_bill
print("Your bill is $",total_bill,end="");
print("\n");
if __name__=="__main__":
main()
What is the TAG to begin a Web page, as recommended by the W3C?
Answer:
<!DOCTYPE html>
Explanation:
Now i could be wrong but this is what we go with in html5 witch is what web browser uses. I sent a photo you could use to help from the W3C website
Acceleration is the rate at which an object changes its velocity. It is typically represented by symbol a and measured in m/s2 (meters per second squared). Write the algorithm (steps in pseudocode) and the corresponding program to calculate the acceleration of a vehicle given the speed in miles per hour and the time in seconds. Use the formula provided below to calculate the acceleration in meters per second squared. The program must prompt the user to enter a velocity in miles per hour and a time in seconds as double precision real numbers and then display the resulting acceleration as a double precision real number. The acceleration must be rounded off to one decimal digit but displayed with two decimal digits.
Answer:
Pseudocode:
INPUT velocity
INPUT time
SET velocity = 0.44704 * velocity
SET acceleration = velocity / time
SET acceleration = round(acceleration, 1)
PRINT acceleration
Code:
velocity = float(input("Enter a velocity in miles per hour: "))
time = float(input("Enter a time in seconds: "))
velocity = 0.44704 * velocity
acceleration = velocity / time
acceleration = round(acceleration, 1)
print("The acceleration is {:.2f}".format(acceleration))
Explanation:
*The code is in Python.
Ask the user to enter the velocity and time
Convert the miles per hour to meters per second
Calculate the acceleration using the formula
Round the acceleration to one decimal using round() method
Print the acceleration with two decimal digits
Fill in the function shopSmart(orders,shops) in shopSmart.py, which takes an orderList (like the kind passed in to FruitShop.getPriceOfOrder) and a list of FruitShop and returns the FruitShop where your order costs the least amount in total. Don't change the file name or variable names, please. Note that we will provide the shop.py implementation as a "support" file, so you don't need to submit yours. Run python autograder.py until question 3 passes all tests and you get full marks. Each test will confirm that shopSmart(orders,shops) returns the correct answer given various possible inputs. For example, with the following variable definitions: orders1 = [('apples',1.0), ('oranges',3.0)] orders2 = [('apples',3.0)] dir1 = {'apples': 2.0, 'oranges':1.0} shop1 = shop.FruitShop('shop1',dir1) dir2 = {'apples': 1.0, 'oranges': 5.0} shop2 = shop.FruitShop('shop2',dir2) shops = [shop1, shop2] test_cases/q3/select_shop1.test tests whether:
Answer:
def shopSmart(orderList, fruitShops): #function definition
shop = fruitShops[0] #sets the shop to first item of fruitShops list
leastAmount = shop.getPriceOfOrder(orderList) #passes the orderList to getPriceOfOrder method which returns the total cost and saves it to leastAmount
for fruitshop in fruitShops[1:]: #iterates through the shops in fruitShops list
cost = fruitshop.getPriceOfOrder(orderList) #checks each cost or order using getPriceOfOrder method and passing orderList to it
if cost < leastAmount: #checks where order costs the least amount in total
shop = fruitshop #sets the FruitShop where order costs the least amount in total
leastAmount = cost #sets that minimum of order cost to leastAmount
return shop #returns the FruitShop where order costs the least amount in total
Explanation:
Here are the getPriceOfOrder() and getName()) methods that is used in the above method.
def getPriceOfOrder(self, orderList):
totalCost = 0.0
for fruit, numPounds in orderList:
costPerPound = self.getCostPerPound(fruit)
if costPerPound != None:
totalCost += numPounds * costPerPound
return totalCost
def getName(self):
return self.name
Here is the main program:
orders = [('apples',1.0), ('oranges',3.0)]
dir1 = {'apples': 2.0, 'oranges':1.0}
shop1 = shop.FruitShop('shop1',dir1)
dir2 = {'apples': 1.0, 'oranges': 5.0}
shop2 = shop.FruitShop('shop2',dir2)
shops = [shop1, shop2]
print("For orders ", orders, ", the best shop is", shopSmart(orders, shops).getName())
orders = [('apples',3.0)]
print("For orders: ", orders, ", the best shop is", shopSmart(orders, shops).getName())
Notice that the statement:
print("For orders ", orders, ", the best shop is", shopSmart(orders, shops).getName())
has orders list which is:
[('apples',1.0), ('oranges',3.0)]
and it has shops which is a list containing two shops:
shops = [shop1, shop2]
It also calls method shopSmart by passing orders and these two shops to get the shop where the order costs the least amount in total. It has a for loop that iterates through each shop and check the orders using getPriceOfOrder method to determine at which shop the order costs the least amount in total. When the least amount is found it is set to the variable leastAmount and the shop corresponding to this order which has least amount is set to shop variable. At the end this shop is returned by the function. getName() method is used in the main program to get the name of the shop with least amount of order cost. So above print statement gives the following output:
For orders [('apples', 1.0), ('oranges', 3.0)] , the best shop is shop1
The entire program along with its output is attached.
Need a little help
Stuck on this question
Answer:
B.
They are the audio technicians so they do all things audio, including sound effects and different voices.
What is another way that the condition below could be written? ( num <= 10 )
Answer:
( (num < 10) || (num = 10) )
Explanation:
Here we have the condition as num <= 10 which means the condition gets satisfied till less than 10 i.e., (9) and condition also gets satisfied when the num is equal to 10 .
We can get same result using ( (num < 10) || (num = 10) ) because in OR when either of the input is true the output is true .
What was the goal of the 2009 Educate to Innovate campaign?
A) promote and develop STEM practitioners and teachers in the fields
B) strengthen America’s global lead in scientific research and education
C) assist American students in becoming leaders in math and science
D) improve technology and attract workers to STEM occupations
The letter choices are randomized for everyone, but the answer is:
— To assist American students in becoming leaders in math and scienceThe 2009 Educate goal is to improve technology and attract workers to STEM occupations.
What is the main goal of STEM?The aim of STEM education is to bring up STEM literacy in terms of knowledge and understanding of scientific and mathematical things.
Therefore, The 2009 Educate goal is to improve technology and attract workers to STEM occupations and thus bring out innovation.
Therefore Option d is correct.
Learn more about STEM from
https://brainly.com/question/18243320
#SPJ9
#TODO: This function needs to accept an incoming message and process it accordingly. # This function is called every time the switch receives a new message. #if message.pathThrough == True and message.origin not in self.activeLinks: #self.activeLinks.append(message.origin) #if message.pathThrough == False and message.origin in self.activeLinks: #self.activeLinks.remove(message.origin)
Answer:
This function is a method of a class object that checks a message path and register or update the previous messages list with only new messages.
Explanation:
def message_check(self ) :
If message.pathThrough == True and \ message.origin not in self.activeLinks:
Self.activeLinks.append( message.origin )
Elif message.pathThrouh == False and \ message.origin in self.activeLinks:
Self.activeLinks.remove( message.origin )
Which one is NOT an Apex Legend Character.
1. Mirage
2. Bangalore
3. Lifeline
4. Lara Croft
5. Crypto
Answer:
lara croft
Explanation:
i think ??????
Answer:
Lara Croft
Explanation:
She from Tomb Raider
A (n) _______________ is a dot or other symbol positioned at the beginning of a paragraph
Question 2 options:
Bullet
Logo
Cell
Target
Answer:
Bullet
Explanation:
I've written a paragraph before. I should know!
Answer: bullet
A bullet is this:
These are placed at the beginning of paragraphs to jot/write down thinking.
So, the answer to this is bullet.
Hope this helps!
Describe the major research, discoveries, or impact Timothy Berners-Lee has made on the scientific community. 100 points for answer and best description gets brainleist
Answer:
Giving you brainiest
Explanation:
Because why not you just gave me a 100
Danielle, Edward, and Francis are three salespeople at Holiday Homes. Write an application named HomeSales that prompts the user for a salesperson initial (D, E, or F ). Either uppercase or lowercase initials are valid. Issue an error message for any invalid initials entered. For any salesperson name initial entered, further prompt a sale amount sold by the salesperson. Afterward, display the salesperson’s name and the sale amount for the salesperson.
Answer:
import java.util.Scanner;
public class HomeSales
{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String name = "";
double sale = 0.0;
System.out.print("Enter a salesperson's initial (D, E, or F ) ");
char initial = input.next().charAt(0);
initial = Character.toUpperCase(initial);
if(initial == 'D')
name = "Danielle";
else if(initial == 'E')
name = "Edward";
else if(initial == 'F')
name = "Francis";
else
System.out.println("Invalid initials entered!");
if(!name.equals("")){
System.out.print("Enter sale amount ");
sale = input.nextDouble();
System.out.println(name + " " + sale);
}
}
}
Explanation:
*The code is in Java.
Initialize the name and sale
Ask the user to enter the initial
Convert initial to uppercase
Check the initial using if else statement and depending on the value, set the name. If a valid initial is entered, print an error.
If the name is not empty (This implies that a valid initial was entered), ask the user to enter the sale amount and print the name and sale amount
What will happen if you delete system32?
What type of volatile memory is used on small systems such as laptops?
Select the correct answer.
A.
SODIMM
B.
ROM
C.
SRAM
D.
DIMM
Answer:
A. SODIMM
Explanation:
SODIMM is the "mini" version of desktop ram. it is smaller to accommodate the laptop's size.
QUESTION 7 of 10: A surplus can be best defined as:
a) Having too much money to spend
b) Not having enough money to meet your expenses
c) Having money left over after meeting your expenses
d) An Actual expense
A surplus can be best defined as having money left over after meeting your expenses. The correct option is c.
What is surplus?Surplus means having an excess amount of something that can be stored for future use. A surplus amount is used when there is more money or anything, like food, that can be used for emergencies.
Here, in the options, the best defines the term surplus is to put or save the excess amount of money or food or other things to use in future or emergency situations.
All others are incorrect because not having enough money to meet your expenses, is the opposite of the meaning of surplus, and the others, like having too much money to spend are also not the meaning of surplus.
Thus, the correct option is c. Having money left over after meeting your expenses.
To learn more about surplus, refer to the below link:
https://brainly.com/question/15416023
#SPJ2
How would you declare an interface named Sports that has the following (show them in your answer as well): A method called jump that has no parameters and does not return anything. A method called throw that has one parameter called distance and is an integer and does not return anything. 2) [5 pts] Assuming the interface exist from 1) above. Give me the class header for a class named Football that would use this interface. 3) [5 pts] Assuming a parent class called GrandParents exist. How would you create a child class called GrandChild that would be a direct child of the class GrandParents
Answer:
See explanation
Explanation:
An interface is declared as follows:
interface interface_name{
member fields
methods }
So the Sports interface is declared as:
interface Sports{ }
You can also write its as:
public interface Sports { }
Now this interface has a method jump that has no parameters and does not return anything. So it is defined as:
void jump();
You can also write it as:
public void jump();
Notice that it has a void keyword which means it does not return anything and empty round brackets show that it has no parameters. Lets add this to the Sports interface:
interface Sports{
void jump(); }
You can write it as:
public interface Sports {
public void void jump(); }
Next, this Sports interface has a method throw that has one parameter called distance and is an integer and does not return anything. So it is defined as:
throw(int distance);
You can also write it as:
public void throw(int distance)
Notice that this function has a void return type and one int type parameter distance. Now lets add this to Sports interface:
interface Sports{
void jump();
void throw(int distance); }
This can also be written as:
public interface Sports {
public void jump();
public void throw(int distance); }
Next, the class header for a class named Football that would use this interface is as follows:
class Football implements Sports{ }
You can use the methods of Sports in Football too. So the complete interface with class Football becomes:
interface Sports{
void jump();
void throw(int distance);
}
class Football implements Sports{
public void print(){
}
public void throw(int distance) {
}
Next we have a parent class called GrandParents. So child class called GrandChild that would be a direct child of the class GrandParents is:
class GrandChild extends GrandParents { }
Basic syntax of a parent class and its child class is:
class child_class_name extends parent_class_name
{
//member fields and methods
}
The Internet is considered a WAN. *
True
False
Answer:
true. internet is definitely wan
The statement the Internet is considered a WAN is true.
We are given that;
The statement about WAN
Now,
A WAN, or a wide area network, is a computer network that spans over a large geographic area, such as regions, countries, or even the world.
The Internet is the largest and most well-known example of a WAN, as it connects millions of devices across the globe using various communication protocols and technologies.
A WAN can also be composed of smaller networks, such as local area networks (LANs) or metropolitan area networks (MANs), that communicate with each other.
Therefore, by WAN the answer will be true.
To learn more about WAN visit;
https://brainly.com/question/32733679
#SPJ6
1. The Percentage of T9 and T10 also have the wrong number format. Change them to the Correct number format(to match the rest of the data in the column). What Value now Shows in T10?
Answer:
60%
Explanation:
After changing the number format of the percentages of T9 and T10, the value that now shows in T10 due to the change from the wrong format to the Right format is 60%
This is because when a value is entered into a column in a wrong format the value would be different from other values entered rightly but when the format is changed to the right format, the correct value would show up.
LAB: Simple statistics
Given 4 floating-point numbers. Use a string formatting expression with conversion specifiers to output their product and their average as integers (rounded), then as floating-point numbers.
Output each rounded integer using the following:
print('{:.0f}'.format(your_value))
Output each floating-point value with three digits after the decimal point, which can be achieved as follows:
print('{:.3f}'.format(your_value))
Ex: If the input is:
8.3
10.4
5.0
4.8
the output is:2072 72071.680 7.125
Answer:
n1 = float(input())
n2 = float(input())
n3 = float(input())
n4 = float(input())
product = n1 * n2 * n3 * n4
average = (n1 + n2 + n3 + n4) / 4
print('{:.0f}'.format(product) + ' {:.0f}'.format(average) + ' {:.3f}'.format(product) + ' {:.3f}'.format(average))
Explanation:
Ask the user to enter 4 numbers as float
Calculate the product, multiply each number
Calculate the average, sum the numbers and divide the sum by 4
Print the results in requested formats
What is production switching?
Answer:
Production switching is one way that a business has of coping with uncertainty. Rather than having one plan that they must remain committed to, the process of production switching allows a business to adjust to new circumstances.
Explanation:
Which of these is an application? Microsoft Windows Linux Microsoft Word Apple ios
Answer:
I think it's Microsoft windows
Answer:
it is microsoft word just took test
Nancy is working on a spreadsheet in excel on a Microsoft windows system. Which statements are true about the software she is using?
A. Microsoft windows is an example of system utility software.
B. Besides system utilities, the only other type of software is application software.
C. Spreadsheet software, such as excel, is an example of application software.
D. Application software control and interact directly with computer hardware.
Answer:
The explanation of this question is given below in explanation section. however, the correct answer is C.
Explanation:
A. Microsoft windows is an example of system utility software (Incorrect). Microsoft windows is an example of system utitilty software. But the Nancy is using spreadsheat in excel software that is example of application software.
B. Besides system utilities, the only other type of software is application software (incorrect). It is right that besides system utlilites, the only other type of software is application software.But this option does not match and make sense about Nancy working on the software.
C. Spreadsheet software, such as excel, is an example of application software (correct). Because, Microsoft Excel (that is spreadsheet software) is an example of application software.
D. Application software control and interact directly with computer hardware (incorrect). Because, driver that are example of utilities software, directly control and interact with hardware. So, this option is incorrect. Excel is an example of application software and application software does not directly control and interact with software.
Answer:
The answer is C. Spreadsheet software, such as excel, is an example of application software.
Explanation:
I got it right on the Edmentum test.
What is the hyperlink for famous viruses ?
Answer: Hope this helps :)
Explanation: Viruses embedded themselves in genuine programs and relied on these programs to propagate. Worms were generally stand alone programs that could install themselves using a network, USB or email program to infect other computers.
Trojan horses took their name from the gift to the Greeks during the Trojan war in Homer’s Odyssey. Much like the wooden horse, a Trojan Horse looks like a normal file until some predetermined action causes the code to execute.
Today’s generation of attacker tools are far more sophisticated, and are often a blend of these techniques.
These so-called “blended attacks” rely heavily on social engineering - the ability to manipulate someone to doing something they wouldn’t normally do – and are often categorised by what they ultimately will do to your systems.
Assume a TCP segment consisting of 1500 bits of data and 160 bits of header is sent to the IP layer, which appends 120 bits of header. This is then transmitted through some networks (via routers), each of which uses a 24-bit of packet header for packet transmissions. The destination network can accept a maximum packet size of 800 bits. How many bits, including headers, are delivered to the network layer protocol at the destination?
Answer:
1852 bits
Explanation:
The total number of bits transmitted = Number of data bits + number of header bits sent to IP layer + number of appended header bits.
The total number of bits transmitted = 1500 bits + 160 bits + 120 bits = 1780 bits
Ratio of number of bits transmitted to maximum packet size = 1780 bits / 800 bits = 2.225 = 3 (to next whole number)
Therefore the number of bits, including headers, are delivered to the network layer protocol at the destination = total number of bits transmitted + (packet header × ratio)
Number of bits = 1780 bits + (3 × 24 bits) = 1852 bits
Need some help with Discrete Mathmatics please help urgent?
Answer: 2, 4, 1, 5, 3
Explanation:
P: Arguments are not arranged in regular order like the one I am used to
Q: I cannot understand ~Q: I can understand
R: I grumble ~R: I do not grumble
S: Get a headache
T: Examples are not easy
Here is the logic order of the given sentences:
2) P
4) P → Q
1) ~Q → ~R
5) ~R → S
3) S → T
∴) T
I’m nobody. Who are you?
Are you nobody, too?
The There’s a pair of us - don’t tell!
They’d banish us, you know.
How dreary to be somebody
How public, like a frog
To tell your name the livelong day
To an admiring bog!
-“I’m nobody. Who are you?”
Emily Dickinson
Which statement best sums up the meaning of the poem
A. The poet wishes for fame
B. The poet praises the common man.
C. the poet states that being a “nobody” is a terrible thing to be
D. The poet believes the unimportant people are like frogs that never stop croaking.
Answer:
The poet praises the common man.
Explanation:
The poet states that being a “nobody” is a terrible thing to be
Who is Poet?One of America's greatest and most creative poets of all time is Emily Dickinson. She claimed definition as her domain and contested the established definitions of poetry and the task of the poet.
Like authors like Walt Whitman, Henry David Thoreau, and Ralph Waldo Emerson, she experimented with expression to liberate it from socially prescribed boundaries.
She created a novel kind of first-person identity, much like authors like Charlotte Bronte and Elizabeth Barrett Browning.
Therefore, The poet states that being a “nobody” is a terrible thing to be .
To learn more about Identity, refer to the link:
https://brainly.com/question/30699830
#SPJ2
As an administrator of the Contoso Corporation, you are responsible for configuring the users’ mobile computers. You want to ensure that when a computer system accesses a public network—such as the local coffee shop, the airport, or the user’s home network—other computers and devices cannot find your system. In addition, you want to disable file and printer sharing access. However, when in the office and the computers connect to the office using a VPN client, you want network discovery and file and printer sharing available. What should you do?
Answer:
What i should do is to modified or change network discovery and file as well as the printer sharing by clicking on the advanced sharing Networking and Sharing Center setting, the second step will be to modified the Public network settings and the third step will be to modified the home network settings .
Explanation:
Based on the information given the first step is to go to Networking and Sharing Center on my system and then click on the
the advanced sharing setting in order for me to modified or change the network discovery and file as well as the printer sharing, although this modification will have to based on the location of the network.
Second step will be to click on the Public network settings and check If network discovery as well as the file/print sharingis is in a disabled mode, once it is in a disabled mode the third step will be for me to change or modified the home network setting in order for it to help disable the network discovery as well as the file/print sharing while the last step will be to check the Domain network settings and the Work network settings which I do not need to change reason been that the setting does not need modification.
The term____relates to all things that we see.
Why is it important for element IDs to have meaningful names
Answer:
to remind of purpose and use
Explanation:
When a data item has a meaningful name, the name can be a reminder of the purpose and use of the item. It can also be suggestive of the range of legitimate values. It also makes error-checking easier.
If the name of it is not meaningful, this information about the item must be found in a dictionary somewhere, often a time-consuming or difficult project. Using elements with non-meaningful IDs provides opportunities for error and confusion--not something that is generally wanted.
Answer:
to remind of purpose and use
When does information become a liability for an organization
Answer:
A. When it is not managed properly
Explanation:
when stuff is not mananged as it should then it becomes a liablilty