Answer:
D.[50, 100, 150, 200, 250]
Explanation:
This is a trick question because the integer n is only a counter and does not affect the array nums. To change the actual array it would have to say...nums[n] = n/nums[0];
what is a case in programming
Answer:
A case in programming is some type of selection, that control mechanics used to execute programs :3
Explanation:
:3
Research: Using the Internet or a library, gather information about the Columbian Exchange. Takes notes about the specific goods and diseases that traveled back and forth across the Atlantic, as well the cultural and political changes that resulted. Pay special attention to the indigenous perspective, which will most likely be underrepresented in your research.
Answer:
Small pox, cacao, tobacco, tomatoes, potatoes, corn, peanuts, and pumpkins.
Explanation:
In the Columbian Exchange, transportation of plants, animals, diseases, technologies, and people from one continent to another held. Crops like cacao, tobacco, tomatoes, potatoes, corn, peanuts, and pumpkins were transported from the Americas to rest of the world. Due to this exchange, Native Americans were also infected with smallpox disease that killed about 90% of Native Americans because this is a new disease for them and they have no immunity against this disease. Due to this disease, the population of native Americans decreases and the population of English people increases due to more settlement.
By using your own data, search engines and other sites try to make your web experience more personalized. However, by doing this, certain information is being hidden from you. Which of the following terms is used to describe the virtual environment a person ends up in when sites choose to show them only certain, customized information?
A filter bubble
A clustered circle
A relational table
An indexed environment
Answer:
A filter bubble
Explanation:
Write a program that will input miles traveled and hours spent in travel. The program will determine miles per hour. This calculation must be done in a function other than main; however, main will print the calculation. The function will thus have 3 parameters: miles, hours, and milesPerHour. Which parameter(s) are pass by value and which are passed by reference
Define and use in your program the following functions to make your code more modular: convert_str_to_numeric_list - takes an input string, splits it into tokens, and returns the tokens stored in a list only if all tokens were numeric; otherwise, returns an empty list. get_avg - if the input list is not empty and stores only numerical values, returns the average value of the elements; otherwise, returns None. get_min - if the input list is not empty and stores only numerical values, returns the minimum value in the list; otherwise, returns None. get_max - if the input list is not empty and stores only numerical values, returns the maximum value in the list; otherwise, returns None.
Answer:
In Python:
def convert_str_to_numeric_list(teststr):
nums = []
res = teststr.split()
for x in res:
if x.isdecimal():
nums.append(int(x))
else:
nums = []
break;
return nums
def get_avg(mylist):
if not len(mylist) == 0:
total = 0
for i in mylist:
total+=i
ave = total/len(mylist)
else:
ave = "None"
return ave
def get_min(mylist):
if not len(mylist) == 0:
minm = min(mylist)
else:
minm = "None"
return minm
def get_max(mylist):
if not len(mylist) == 0:
maxm = max(mylist)
else:
maxm = "None"
return maxm
mystr = input("Enter a string: ")
mylist = convert_str_to_numeric_list(mystr)
print("List: "+str(mylist))
print("Average: "+str(get_avg(mylist)))
print("Minimum: "+str(get_min(mylist)))
print("Maximum: "+str(get_max(mylist)))
Explanation:
See attachment for complete program where I use comment for line by line explanation
Computer programming
What techniques overcome resistance and improve the credibility of a product? Check all that apply.
Including performance tests, polls, or awards
Listing names of satisfied users
Sending unwanted merchandise
Using a celebrity name without authorization
Answer: Including performance tests, polls, or awards.
Listing names of satisfied users
Explanation:
For every business, it is important to build ones credibility as this is vital on keeping ones customers and clients. A credible organization is trusted and respected.
The techniques that can be used to overcome resistance and improve the credibility of a product include having performance tests, polls, or awards and also listing the names of satisfied users.
Sending unwanted merchandise and also using a celebrity name without authorization is bad for one's business as it will have a negative effect on the business credibility.
Which of the following is step two of the Five-Step Worksheet Creation Process?
Answer:
Add Labels.
As far as i remember.
Explanation:
Hope i helped, brainliest would be appreciated.
Have a great day!
~Aadi x
Add Labels is step two of the Five-Step Worksheet Creation Process. It helps in inserting the data and values in the worksheet.
What is label worksheet in Excel?A label in a spreadsheet application like Microsoft Excel is text that offers information in the rows or columns around it. 3. Any writing placed above a part of a chart that provides extra details about the value of the chart is referred to as a label.
Thus, it is Add Labels
For more details about label worksheet in Excel, click here:
https://brainly.com/question/14719484
#SPJ2
How are BGP neighbor relationships formed
Automatically through BGP
Automatically through EIGRP
Automatically through OSPF
They are setup manually
Answer:
They are set up manually
Explanation:
BGP neighbor relationships formed "They are set up manually."
This is explained between when the BGP developed a close to a neighbor with other BGP routers, the BGP neighbor is then fully made manually with the help of TCP port 179 to connect and form the relationship between the BGP neighbor, this is then followed up through the interaction of any routing data between them.
For BGP neighbors relationship to become established it succeeds through various phases, which are:
1. Idle
2. Connect
3. Active
4. OpenSent
5. OpenConfirm
6. Established
Explain 2 ways in which data can be protected in a home computer??
Answer:
The cloud provides a viable backup option. ...
Anti-malware protection is a must. ...
Make your old computers' hard drives unreadable. ...
Install operating system updates. ...
37) Which of the following statements is true
A) None of the above
B) Compilers translate high-level language programs into machine
programs Compilers translate high-level language programs inton
programs
C) Interpreter programs typically use machine language as input
D) Interpreted programs run faster than compiled programs
Answer:
B
Explanation:
its b
Answer:
A C E
Explanation:
I got the question right.
Scenario
Your task is to prepare a simple code able to evaluate the end time of a period of time, given as a number of minutes (it could be arbitrarily large). The start time is given as a pair of hours (0..23) and minutes (0..59). The result has to be printed to the console.
For example, if an event starts at 12:17 and lasts 59 minutes, it will end at 13:16.
Don't worry about any imperfections in your code - it's okay if it accepts an invalid time - the most important thing is that the code produce valid results for valid input data.
Test your code carefully. Hint: using the % operator may be the key to success.
Test Data
Sample input:
12
17
59
Expected output: 13:16
Sample input:
23
58
642
Expected output: 10:40
Sample input:
0
1
2939
Expected output: 1:0
Answer:
In Python:
hh = int(input("Start Hour: "))
mm = int(input("Start Minute: "))
add_min = int(input("Additional Minute: "))
endhh = hh + (add_min // 60)
endmm = mm + (add_min % 60)
endhh += endmm // 60
endmm = endmm % 60
endhh = endhh % 24
print('{}:{}'.format(endhh, endmm))
Explanation:
This prompts the user for start hour
hh = int(input("Start Hour: "))
This prompts the user for start minute
mm = int(input("Start Minute: "))
This prompts the user for additional minute
add_min = int(input("Additional Minute: "))
The following sequence of instruction calculates the end time and end minute
endhh = hh + (add_min // 60)
endmm = mm + (add_min % 60)
endhh += endmm // 60
endmm = endmm % 60
endhh = endhh % 24
This prints the expected output
print('{}:{}'.format(endhh, endmm))
Suppose you design a banking application. The class CheckingAccount already exists and implements interface Account. Another class that implements the Account interface is CreditAccount. When the user calls creditAccount.withdraw(amount) it actually makes a loan from the bank. Now you have to write the class OverdraftCheckingAccount, that also implements Account and that provides overdraft protection, meaning that if overdraftCheckingAccount.withdraw(amount) brings the balance below 0, it will actually withdraw the difference from a CreditAccount linked to the OverdraftCheckingAccount object. What design pattern is appropriate in this case for implementing the OverdraftCheckingAccount class
Answer:
Strategy
Explanation:
The strategic design pattern is defined as the behavioral design pattern that enables the selecting of a algorithm for the runtime. Here the code receives a run-time instructions regarding the family of the algorithms to be used.
In the context, the strategic pattern is used for the application for implementing OverdraftCheckingAccount class. And the main aspect of this strategic pattern is the reusability of the code. It is behavioral pattern.
This is computer and programming
Answer:yes
Explanation:because
describe the major elements and issues with agile development
Answer:
water
Explanation:
progresses through overtime
Write a SELECT statement that returns these columns from the Orders table: The CardNumber column The length of the CardNumber column The last four digits of the CardNumber columnWhen you get that working right, add the column that follows to the result set. This is more difficult because the column requires the use of functions within functions. A column that displays the last four digits of the CardNumber column in this format: XXXX-XXXX-XXXX-1234. In other words, use Xs for the first 12 digits of the card number and actual numbers for the last four digits of the number.selectCardNumber,len(CardNumber) as CardNumberLegnth,right(CardNumber, 4) as LastFourDigits,'XXXX-XXXX-XXXX-' + right(CardNumber, 4) as FormattedNumberfrom Orders
Answer:
SELECT
CardNumber,
len(CardNumber) as CardNumberLength,
right(CardNumber, 4) as LastFourDigits,
'XXXX-XXXX-XXXX-' + right(CardNumber, 4) as FormattedNumber
from Orders
Explanation:
The question you posted contains the answer (See answer section). So, I will only help in providing an explanation
Given
Table name: Orders
Records to select: CardNumber, length of CardNumber, last 4 digits of CardNumber
From the question, we understand that the last four digits should display the first 12 digits as X while the last 4 digits are displayed.
So, the solution is as follows:
SELECT ----> This implies that the query is to perform a select operation
CardNumber, ---> This represents a column to read
len(CardNumber) as CardNumberLength, -----> len(CardNumber) means that the length of card number is to be calculated.
as CardNumberLength implies that an CardNumberLength is used as an alias to represent the calculated length
right(CardNumber, 4) as LastFourDigits, --> This reads the 4 rightmost digit of column CardNumber
'XXXX-XXXX-XXXX-' + right(CardNumber, 4) as FormattedNumber --> This concatenates the prefix XXXX-XXXX-XXXX to the 4 rightmost digit of column CardNumber
as FormattedNumber implies that an FormattedNumber is used as an alias to represent record
from Orders --> This represents the table where the record is being read.
write essay about pokhara
Explanation:
Pokhara is the second most visited city in Nepal, as well as one of the most popular tourist destinations. It is famous for its tranquil atmosphere and the beautiful surrounding countryside. Pokhara lies on the shores of the Phewa Lake. From Pokhara you can see three out of the ten highest mountains in the world (Dhaulagiri, Annapurna, Manasalu). The Machhapuchre (“Fishtail”) has become the icon of the city, thanks to its pointed peak.
As the base for trekkers who make the popular Annapurna Circuit, Pokhara offers many sightseeing opportunities. Lakeside is the area of the town located on the shores of Phewa Lake, and it is full of shops and restaurants. On the south-end of town, visitors can catch a boat to the historic Barahi temple, which is located on an island in the Phewa Lake.
On a hill overlooking the southern end of Phewa Lake, you will find the World Peace Stupa. From here, you can see a spectacular view of the lake, of Pokhara and Annapurna Himalayas. Sarangkot is a hill on the southern side of the lake which offers a wonderful dawn panorama, with green valleys framed by the snow-capped Annapurnas. The Seti Gandaki River has created spectacular gorges in and around the city. At places it is only a few meters wide and runs so far below that it is not visible from the top
Pokhara is a beautiful city located in the western region of Nepal. It is the second largest city in Nepal and one of the most popular tourist destinations in the country. The city is situated at an altitude of 827 meters above sea level and is surrounded by stunning mountain ranges and beautiful lakes. Pokhara is known for its natural beauty, adventure activities, and cultural significance.
One of the most famous attractions in Pokhara is the Phewa Lake, which is the second largest lake in Nepal. It is a popular spot for boating, fishing, and swimming. The lake is surrounded by lush green hills and the Annapurna mountain range, which provides a stunning backdrop to the lake.
Another popular attraction in Pokhara is the World Peace Pagoda, which is a Buddhist stupa located on top of a hill. The stupa is a symbol of peace and was built by Japanese Buddhist monks. It provides a panoramic view of the city and the surrounding mountains.
The city is also known for its adventure activities, such as paragliding, zip-lining, and bungee jumping. These activities provide a unique and thrilling experience for tourists who are looking for an adrenaline rush.
In addition to its natural beauty and adventure activities, Pokhara is also significant for its cultural heritage. The city is home to many temples, such as the Bindhyabasini Temple, which is a Hindu temple dedicated to the goddess Bhagwati. The temple is located on a hill and provides a panoramic view of the city.
Overall, Pokhara is a city that has something to offer for everyone. It is a perfect destination for those who are looking for natural beauty, adventure activities, and cultural significance. The city is easily accessible by road and air, and is a must-visit destination for anyone who is planning to visit Nepal.
Part 1 of 4 parts for this set of problems: Given an 4777 byte IP datagram (including IP header and IP data, no options) which is carrying a single TCP segment (which contains no options) and network with a Maximum Transfer Unit of 1333 bytes. How many IP datagrams result, how big are each of them, how much application data is in each one of them, what is the offset value in each. For the first of four datagrams: Segment
Answer:
Fragment 1: size (1332), offset value (0), flag (1)
Fragment 2: size (1332), offset value (164), flag (1)
Fragment 3: size (1332), offset value (328), flag (1)
Fragment 4: size (781), offset value (492), flag (1)
Explanation:
The maximum = 1333 B
the datagram contains a header of 20 bytes and a payload of 8 bits( that is 1 byte)
The data allowed = 1333 - 20 - 1 = 1312 B
The segment also has a header of 20 bytes
the data size = 4777 -20 = 4757 B
Therefore, the total datagram = 4757 / 1312 = 4
Chris recently received an array p as his birthday gift from Joseph, whose elements are either 0 or 1. He wants to use it to generate an infinite long superarray. Here is his strategy: each time, he inverts his array by bits, changing all 0 to 1 and all 1 to 0 to get another array, then concatenate the original array and the inverted array together. For example, if the original array is [0,1,1,0] then the inverted array will be [1,0,0,1] and the new array will be [0,1,1,0,1,0,0,1]. He wonders what the array will look like after he repeat this many many times.
He ask you to help him sort this out. Given the original array pp of length ????n and two indices a,b (????≪????≪????, means much less than) Design an algorithm to calculate the sum of elements between a and b of the generated infinite array p^, specifically, ∑????≤????≤????p????^. He also wants you to do it real fast, so make sure your algorithm runs less than O(b) time. Explain your algorithm and analyze its complexity.
Answer:
its c
Explanation:
what does the
command do
Write a function named printPattern that takes three arguments: a character and two integers. The character is to be printed. The first integer specifies the number of times that the character is to be printed on a line (repetitions), and the second integer specifies the number of lines that are to be printed. Also, your function must return an integer indicating the number of lines multiplied by the number of repetitions. Write a program that makes use of this function. That is in the main function you must read the inputs from the user (the character, and the two integers) and then call your function to do the printing.
Answer:
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
char c;
int n1, n2;
System.out.print("Enter the character: ");
c = input.next().charAt(0);
System.out.print("Enter the number of times that the character is to be printed on a line: ");
n1 = input.nextInt();
System.out.print("Enter the number of lines that are to be printed: ");
n2 = input.nextInt();
printPattern(c, n1, n2);
}
public static int printPattern(char c, int n1, int n2){
for (int i=0; i<n2; i++){
for (int j=0; j<n1; j++){
System.out.print(c);
}
System.out.println();
}
return n1 * n2;
}
}
Explanation:
*The code is in Java.
Create a function named printPattern that takes one character c, and two integers n1, n2 as parameters
Inside the function:
Create a nested for loop. Since n2 represents the number of lines, the outer loop needs to iterate n2 times. Since n1 represents the number of times that the character is to be printed, the inner loop iterates n1 times. Inside the inner loop, print the c. Also, to have a new line after the character is printed n1 times on a line, we need to write a print statement after the inner loop.
Return the n1 * n2
Inside the main:
Declare the variables
Ask the user to enter the values for c, n1 and n2
Call the function with these values
__________ type of storage is very popular to store music, video and computer programs.
i am doing my homework plzz fast
Answer:
Optical storage devices.
Explanation:
Optical storage device are those devices that read and store data using laser. To store data in optical storage devices low-power laser beams are used. It is a type of storage that stores data in an optical readability medium.
Examples of the optical storage device includes Compact disc (CD) and DVD.
The optical storage device is popular in storing data of music, videos, and computer program. Therefore, the optical storage device is the correct answer.
Goal: The campus squirrels are throwing a party! Do not ask. They need you to write a method that will determine whether it will be successfull (returns true) or not (returns false). The decision will be based on int values of the two parameters "squirrels" and "walnuts" representing respectively the number of squirrels attending the party and the numbers of walnuts available to them. The rules for making that determination are detailed below. Variables declarations & initialization: Boolean variable named "result", initialized to false. Steps for the code: First, if less than 1 squirrel attends, then "result" is assigned false. Else, we consider the following conditions: If we have less than, or exactly, 10 squirrels attending: Then: If we have less than 15 walnuts, Then: "result" is set to false. Else: if we have less than, or exactly, 30 walnuts Then: "result" is set to true. Else: "result" is set to false. Else: If less than, or exactly, 30 squirrels are attending Then: If the number of walnuts is more or equal to twice the number of squirrels attending Then: "result" is set to true Else: "result" is set to false Else: If the number of walnuts is equal to 60 plus the number of squirrels attending minus 30 Then: "result" is set to true Else: "result" is set to false
Answer:
Following are the code to the given question:
#include<iostream>// header file
using namespace std;
int main()//main function
{
int squirrels, walnuts;//defining integer variable
bool result = false; //defining a bool variable that holds a false value
cout<<"Enter the number of squirrels"<<endl;//print message
cin>>squirrels; // input integer value
cout<<"Enter the number of walnuts"<<endl;//print message
cin>>walnuts; // input integer value
if(squirrels < 1)//use if variable that checks squirrels value less than 1
{
result = false;//use result variable that holds false value
}
else//defining else block
{
if(squirrels <= 10)//use if variable that checks squirrels value less than equal to 10
{
if(walnuts < 15) //use if variable that checks walnuts value less than 15
result = false;//use result variable that holds false value
else if(walnuts <= 30)//use elseif block that checks walnuts less than equal to 30
result = true; //use result variable that holds true value
else //defining else block
result = false;//use result variable that holds false value
}
else if(squirrels <= 30)//use elseif that checks squirrels value less than equal to 30
{
if(walnuts >= 2*squirrels) //use if block to check walnuts value greater than equal to 2 times of squirrels
result = true; //use result variable that holds true value
else//defining else block
result = false;//use result variable that holds false value
}
else if(walnuts == 60 + squirrels - 30)//using elseif that checks walnuts value equal to squirrels
result = true;//use result variable that holds true value
else //defining else block
result = false;//use result variable that holds false value
}
if(result)//use if to check result
cout<<"True";//print True as a message
else //defining else block
cout<<"False";//print False as a message
return 0;
}
Output:
Enter the number of squirrels
10
Enter the number of walnuts
30
True
Explanation:
In this code, two integer variable "squirrels and walnuts" and one bool variable "result" is declared, in which the integer variable use that input the value from the user-end, and inside this the multiple conditional statements is used that checks integer variable value and use the bool variable to assign value as per given condition and at the last, it uses if block to check the bool variable value and print its value.
Is there SUM in Small basic?
Answer:
no
Explanation:
In this exercise, you are going to build a hierarchy to create instrument objects. We are going to create part of the orchestra using three classes, Instrument, Wind, and Strings. Note that the Strings class has a name very close to the String class, so be careful with your naming convention!We need to save the following characteristics:Name and family should be saved for all instrumentsWe need to specify whether a strings instrument uses a bowWe need to specify whether a wind instrument uses a reedBuild the classes out with getters and setters for all classes. Only the superclass needs a toString and the toString should print like this:Violin is a member of the String family.Your constructors should be set up to match the objects created in the InstrumentTester class.These are the files givenpublic class InstrumentTester{public static void main(String[] args){/*** Don't Change This Tester Class!** When you are finished, this should run without error.*/Wind tuba = new Wind("Tuba", "Brass", false);Wind clarinet = new Wind("Clarinet", "Woodwind", true); Strings violin = new Strings("Violin", true);Strings harp = new Strings("Harp", false); System.out.println(tuba);System.out.println(clarinet); System.out.println(violin);System.out.println(harp);}}////////////////////////////public class Wind extends Instrument{}///////////////////////////public class Strings extends Instrument{ }/////////////////////////public class Instrument{ }
Answer:
Explanation:
The following code is written in Java and creates the classes, variables, and methods as requested. The String objects created are not being passed a family string argument in this question, therefore I created two constructors for the String class where the second constructor has a default value of String for family.
package sample;
class InstrumentTester {
public static void main(String[] args) {
/*** Don't Change This Tester Class!** When you are finished, this should run without error.*/
Wind tuba = new Wind("Tuba", "Brass", false);
Wind clarinet = new Wind("Clarinet", "Woodwind", true);
Strings violin = new Strings("Violin", true);
Strings harp = new Strings("Harp", false);
System.out.println(tuba);
System.out.println(clarinet);
System.out.println(violin);
System.out.println(harp);
}
}
class Wind extends Instrument {
boolean usesReef;
public Wind(String name, String family, boolean usesReef) {
this.setName(name);
this.setFamily(family);
this.usesReef = usesReef;
}
public boolean isUsesReef() {
return usesReef;
}
public void setUsesReef(boolean usesReef) {
this.usesReef = usesReef;
}
}
class Strings extends Instrument{
boolean usesBow;
public Strings (String name, String family, boolean usesBow) {
this.setName(name);
this.setFamily(family);
this.usesBow = usesBow;
}
public Strings (String name, boolean usesBow) {
this.setName(name);
this.setFamily("String");
this.usesBow = usesBow;
}
public boolean isUsesBow() {
return usesBow;
}
public void setUsesBow(boolean usesBow) {
this.usesBow = usesBow;
}
}
class Instrument{
private String family;
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getFamily() {
return family;
}
public void setFamily(String family) {
this.family = family;
}
public String toString () {
System.out.println(this.getName() + " is a member of the " + this.getFamily() + " family.");
return null;
}
}
. Suppose an instruction takes 1/2 microsecond to execute (on the average), and a page fault takes 250 microseconds of processor time to handle plus 10 milliseconds of disk time to read in the page. (a) How many pages a second can the disk transfer? (b) Suppose that 1/3 of the pages are dirty. It takes two page transfers to replace a dirty page. Compute the average number of instructions between page fault that would cause the system to saturate the disk with page traffic, that is, for the disk to be busy all the time doing page transfers.
Answer:
a. 100.
b. 31500.
Explanation:
So, we are given the following data which is going to help in solving this particular question.
The time required to execute (on the average) = 1/2 microsecond , a page fault takes of processor time to handle = 250 microseconds and the disk time to read in the page = 10 milliseconds.
Thus, the time taken by the processor to handle the page fault = 250 microseconds / 1000 = 0.25 milliseconds.
The execution time = [ 1/2 microseconds ]/ 1000 = 0.0005 milliseconds.
The number of Pages sent in a second by the disc = 1000/10 milliseconds = 100.
Assuming U = 1.
Hence, the disc transfer time = [2/3 × 1 } + [ 1/3 × 0.25 milliseconds + 15 ] × 2.
=0.667 + 15.083.
= 15.75 millisecond.
Average number of instruction = 15.75/0.0005 = 31500.
It should be noted that the number of pages in a second will be 100 pages.
From the information given, it was stated that the instruction takes 1/2 microsecond to execute and a page fault takes 250 microseconds of processor time to handle plus 10 milliseconds of disk time to read the page.
Therefore, the execution time will be:
= 0.5/1000
= 0.0005
Therefore, the number of pages will be:
= 1000/10
= 100
Also, the disc transfer time will be;
= (2/3 × 1) + (1/3 × 0.25 + 15) × 2
= 0.667 + 15.083
= 15.75
Therefore, the average number of instructions will be:
= 15.75/0.0005
= 31500
Learn more about time taken on:
https://brainly.com/question/4931057
Under which command group will you find the options to configure Outlook rules?
O Move
O New
O Quick Steps
O Respond
Answer:
Move
Explanation:
I hope that helps :)
Answer:
a). move
Explanation:
edge 2021 <3
what is the address of the first SFR (I/O Register)
Answer:
The Special Function Register (SFR) is the upper area of addressable memory, from address 0x80 to 0xFF.
Explanation:
The Special Function Register (SFR) is the upper area of addressable memory, from address 0x80 to 0xFF.
Reason -
A Special Function Register (or Special Purpose Register, or simply Special Register) is a register within a microprocessor, which controls or monitors various aspects of the microprocessor's function.
At a coffee shop, a coffee costs $1. Each coffee you purchase, earns one star. Seven stars earns a free coffee. In turn, that free coffee earns another star. Ask the user how many dollars they will spend, then output the number of coffees that will be given and output the number of stars remaining. Hint: Use a loop
Answer:
Explanation:
The following is written in Python, no loop was needed and using native python code the function is simpler and more readable.
import math
def coffee():
dollar_amount = int(input("How much money will you be using for your purchase?: "))
free_coffees = math.floor(dollar_amount / 7)
remaining_stars = dollar_amount % 7
print("Dollar Amount: " + str(dollar_amount))
print("Number of Coffees: " + str(dollar_amount + free_coffees))
print("Remaining Stars: " + str(remaining_stars))
Consider the following:
calc = 3 * 5 + 4 ** 2 - 1
What is the base for the exponent?
8
4
5
3
Answer:
3 * 5 + 4 ** 2 - 1 = 5
Explanation:
3 * 5 = 15 + 4 ** 2 = 76 - 1 = 75
The exponent of a number shows how many times a base integer should be multiplied. It is represented as a tiny number in the top right corner of a base number, and the further calculation can be defined as follows:
Given:
[tex]\bold{calc = 3 * 5 + 4 ** 2 - 1}[/tex]
Calculation:
[tex]\bold{calc = 3 \times 5 + 4^2 - 1}\\\\\bold{calc = 15 + 16 - 1}\\\\\bold{calc = 15 + 15 }\\\\\bold{calc = 30 }\\\\[/tex]
The given code is a part of the python program, in which we use the power expression. It implies that one "*" symbol is used to multiply the value and "**" and two symbols are used for calculating the power value.Therefore, the answer is "4".
Learn more:
brainly.com/question/9857728