Answer:
Explanation:
The following code is written in Python. It is a function that takes in a list of ints as a parameter. It then creates two variables one for sum and for max. It then loops through the list adding all the values to sum and adding only the largest value to max. Then it creates a variable called avg which calculates the average by dividing the variable sum by the number of elements in the list. Finally, it returns both avg and max to the user.
def avg_and_max(my_list):
sum = 0
max = 0
for x in my_list:
sum += x
if x > max:
max = x
avg = sum / len(my_list)
return avg, max
Ask the user to type in an integer greater than 50 and assign it to a variable called x. Write a program to calculate the sum of squares of positive integers. The loop should stop when the sum is greater than x. At the end of the loop print how many numbers were used to calculate the sum. For example, if x is 100, sum will be 91, and six numbers (1 to 6) were used to calculate sum.
Answer:
The solution in Python is as follows:
num = int(input("Number: "))
if num>50:
sum = 0
count = 0
for i in range(1,num):
count = count + 1
sum = sum + i**2
if sum > num:
sum = sum - i**2
count = count - 1
break;
print("Sum: "+str(sum))
print("Numbers: "+str(count))
else:
print("Number must be greater than 50")
Explanation:
The condition stated in the question do not conform with the example. The question says, the loop should stop when sum > x.
But:
When x = 100 and sum = 91, the program loop should not stop because 91 is not greater than 100.
However, I'll answer based on the example given in the question.
This prompts user for number
num = int(input("Number: "))
The following if condition is executed if number is greater than 50
if num>50:
This initializes sum to 0
sum = 0
This initializes count to 0
count = 0
The iterates through the inputted number (e.g. 100)
for i in range(1,num):
This increases the count
count = count + 1
This calculates the sum of square of the positive integer
sum = sum + i**2
The following removes excess number from the sum
if sum > num:
sum = sum - i**2
count = count - 1
break;
This prints the calculated sum
print("Sum: "+str(sum))
This prints the count of number used
print("Numbers: "+str(count))
The following is executed if user input is less than 50
else:
print("Number must be greater than 50")
The Matlab Script should:1. Clear the command window2. Clear the workspaceQuestion 1: Why do we clear the command window and workspace at the beginning of a script
Answer:
This is done for the simple reason of having more space to work on
Explanation:
This is done for the simple reason of having more space to work on. By clearing the command window and workspace you provide yourself with sufficient space to create new commands without the clutter of the previous commands. This also prevents your focus from shifting towards old commands and allows you to simply focus on the commands you are currently working on. This does not clear all variables from the script, it only clears the current screen but the previous commands can still be accessed by using the up-arrow key
All of the following are data providers included with .NET for accessing and manipulating data in databases, EXCEPT ____. Group of answer choices
Complete Question:
All of the following are data providers included with .NET for accessing and manipulating data in databases, EXCEPT ____.
Group of answer choices.
A. OLE DB
B. ODBC
C. SQL Server
D. Access
Answer:
D. Access
Explanation:
A database management system (DBMS) can be defined as a collection of software applications that typically enables computer users to create, store, modify, retrieve and manage data or informations in a database. Generally, it allows computer users to efficiently retrieve and manage their data with an appropriate level of security.
A data dictionary can be defined as a centralized collection of information on a specific data such as attributes, names, fields and definitions that are being used in a computer database system.
In a data dictionary, data elements are combined into records, which are meaningful combinations of data elements that are included in data flows or retained in data stores.
This ultimately implies that, a data dictionary found in a computer database system typically contains the records about all the data elements (objects) such as data relationships with other elements, ownership, type, size, primary keys etc. This records are stored and communicated to other data when required or needed.
Basically, when a database management system (DBMS) receives data update requests from application programs, it simply instructs the operating system installed on a server to provide the requested data or informations.
Some examples of data providers included with .NET for accessing and manipulating data in databases are;
A. OLE DB: this is an acronym for Object Linking and Embedding Database. OLE DB was designed and developed by Microsoft corporation and it comprises of various application programming interfaces (APIs) used for data access.
B. ODBC: it is an acronym for Open Database Connectivity and it was designed and developed by Microsoft corporation used for data access through structured query language (SQL).
C. SQL Server: it is a domain-specific language server designed and developed for managing the various data saved in a relational or structured database.
doubleUp Write a method doubleUp that doubles the size of a list of integers by doubling-up each element in the list. Assume there's enough space in the array to double the size. Suppose a list stores the values [1, 3, 2, 7]. After calling list.doubleUp(), the list should store the values [1, 1, 3, 3, 2, 2, 7, 7].
Answer:
The solution in Python is as follows:
class myClass:
def doubleUp(self,myList):
myList[:0] = myList[::2] = myList[1::2] = myList[:]
mylist = [1, 3, 2, 7]
list = myClass()
list.doubleUp(mylist)
print(mylist)
Explanation:
To create a method in Python, the first step is to create a Class.
This is done in the following line:
class myClass:
Then this line defines the method
def doubleUp(self,myList):
This line duplicates the elements of the list
myList[:0] = myList[::2] = myList[1::2] = myList[:]
This defines the list
mylist = [1, 3, 2, 7]
This creates an instance of the class
list = myClass()
This passes the list to the doubleUp method
list.doubleUp(mylist)
This prints the duplicated list
print(mylist)
What is the difference between MySQL and MariaDB?
Answer:
Explained below
Explanation:
They are both server database.
MySQL Server database has two licensing options namely GPLv2 and Enterprise. Whereas, MariaDB Server database is one that has only one license which it is licensed to namely GPLv2.
Now, the license for both of them differs in that the one for MySQL Server database comes with some available features and support. Whereas, the one for MariaDB comes with the full-featured package.
Which feature of dart helps in making the code readable,maintainable and finds type error during compile time
Answer:
Sound
Explanation:
Dart is object oriented. It's sound feature helps to make codes more maintainable and readable. The sound type system means that one can never experience w state where where an expression would evaluate to a value that wouldn't match that expressions static type.
The sound system makes the code to be unambiguous. It makes the code to be easier to read as types cannot lie, also your code would be more maintainable since when a piece of code gets to be changed, you would be warned of other pieces that may have gotten broken.
It should be noted that the sound is the feature of dart helps in;
making the code readablemaintainable finds type error during compile time.According to the question, we are to discuss the feature of dart helps in making the code readable and helps in detecting the error as at time if compilation.
As a result of this we can see that sound system makes the code to be unambiguous and it helps in making the code readable.
Therefore, sound is the feature of dart helps in making the code readable.
Learn more about feature of dart
https://brainly.com/question/14312978
A medical record that contains computer-generated reports, collects data, and shares data with outside agencies is a
Answer:
Electronic Health Record
Explanation:
ELECTRONIC HEALTH RECORD is a medical record which helps to collect patients data pertaining the patients medical information and history such as the patient diagnosis, the treatment that was given to the patient and the medication given to the patient, by then sharing the collected and store medical data or information with external agencies in order to reduce any medical mistakes that may want to arise and to as well provide high quality health care service to the patient as regards to the patient already stored medical history on the ELECTRONIC HEALTH RECORD.
Timothy is an architect. He needs to create a prototype of a new apartment that his firm is building. Which multimedia software would he use? A. image editing program B. painting program C. animation program D. digital video program E. 3D modeling program
Nia is editing a row in an Access table. The row contains the Pencil icon on the left end of the record
this icon indicate?
A. The record is committed.
B. The record has not been written.
C. The record has been written.
D. Nia is editing the record currently.
Answer:
The answer is D
Explanation:
That little pencil reminds you that you are entering or editing the current record, and that the changes you are making are not yet saved. The little pencil disappears as soon as you move off the current record. Take that as confirmation that Access has saved your new record, or the changes you made to an existing one.
In the case above, The row has the Pencil icon on the left end of the record this icon indicate Nia is editing the record currently.
What is record?A record is known to be the state or fact of an act been put down or is been recorded.
Note that In the case above, The row has the Pencil icon on the left end of the record this icon indicate Nia is editing the record currently as it shows the pen icon.
Learn more about record from
https://brainly.com/question/25562729
#SPJ9
Jim wants to enlarge a black-and-white photograph with a warm-black tone. What type of black-and-white paper emulsion should Jim use for this
process?
A chlorobromide
B. bromide
C. chloride
D platinum
Answer:
A. Chlorobromide
Explanation:
I took the test and got it right. (Plato)
The type of black-and-white paper emulsion should be used by Jim is chlorobromide. Thus, option (A) is correct.
What is emulsion?A sort of colloid called an emulsion is created by mixing two liquids that wouldn't typically mix. A dispersion of the other liquid is present in one liquid in an emulsion.
Emulsions frequently occur in foods like egg yolk, butter, and mayonnaise. Emulsification is the process of combining liquids to create an emulsion.
According to the above scenario, Jim wishes to expand a warm-toned black-and-white photograph. For this purpose, he should use chlorobromide for black-and-white paper emulsion.
Paper covered with a chemical compound that is light-sensitive, which is inferred as photographic paper. When exposed to light, it captures the latent image.
Therefore, it can be concluded that option (A) is correct.
Learn more about emulsion here:
https://brainly.com/question/6677364
#SPJ2
The process of auditing the source code for an application to verify that the proper security controls are present, that they work as intended, and that they have been invoked in all the right places is known as
Answer:
Security code review.
Explanation:
The process of auditing the source code for an application to verify that the proper security controls are present, that they work as intended, and that they have been invoked in all the right places is known as security code review.
The main purpose of security code review is to ensure that all the necessary security measures or procedures are adopted (available), to confirm the level of accuracy of its operations, and verify that all loopholes for unauthorized access or use by attackers is prevented.
Hence, various software developers employ the security code review process in order to ensure that the integrity and safety of their software applications or programs are present.
Code review is the process for auditing the source codes and is a an application that is used for verification of the proper security control that are present and that they are intended to use.
The code review is to assure the quality of the software and verity the activity that checks the program mainly for viewing the parts of code.Learn more about the source code for an application to verify that the
brainly.com/question/24749514.
A drop light that does not allow any electrical parts to come in contact with the outer casing of the device is called a:
Answer:
The right answer is "Double insulated light".
Explanation:
Double insulated led is mostly a sophisticated type of natural light that does not necessitate a terrestrial or planetary correlation. These illuminations could be based on these metals, are indicated in the electrical protection environmental standards that now the construction workers comply with, and therefore are readily accessible about every bedroom.The following program calculates yearly and monthly salary given an hourly wage. The program assumes a work-hours-per-week of 40 and work-weeks-per-year of 50. Insert the correct number in the code below to print a monthly salary. Then run the program. The monthly salary should be 3333.333... .
Answer:
The program implemented in Python is as follows:
hourly=float(input("Hourly Wage: "))
print("Annual Rate: "+str(hourly * 40 * 50))
print("Monthly Rate: "+str(round((hourly * 40 * 50/12),2)))
Explanation:
The question is incomplete as the missing code is not given. However, I've written the program from scratch in python.
This prompts the program user for the hourly Wage;
hourly=float(input("Hourly Wage: "))
This calculates and prints the annual rate
print("Annual Rate: "+str(hourly * 40 * 50))
This calculates and prints the monthly rate
print("Monthly Rate: "+str(round((hourly * 40 * 50/12),2)))
Note:
The annual rate is calculated by multiplying the hourly wage to number of hours per week (40) to number of weeks per year (50)
The monthly rate is calculated by [tex]annual\ rate/12[/tex]