Write a function writel that will write the length of a side of a square. If only one argument is passed to the function, it is the length, and the output will go to the Command Window. If two arguments are passed, however, the first argument will be the length and the second argument will be the file identifier for an output file to which the length should be printed.

Answers

Answer 1

def writel(length, file_name = ""):

   if file_name!="":

       f = open(file_name, "w")

       f.write(str(length))

       f.close()

   else:

       print(str(length))

writel(3, "FileName.txt")

I hope this helps!

Remember, you must have the file created prior to running this program. Best of luck.

Answer 2

Answer: Answer to this question for MatLab

Explanation:

function out = write1(length,varargin)

if nargin == 1

   disp(length)

end

if nargin == 2

   fid = fopen(varargin{1},'w');

   fprintf(fid,'%d',length) %

   fclose(fid);

end

end

%varargin{1} needs to be the name of a file you already created


Related Questions

What are the role of social networking sites in our community

Answers

Answer:

please mark me as a brainliest

Explanation:

Rules for all social networking

share several times a day,but space

out your post every few hours.

Respond to all comments as quickly as you can.

Know the art of the hashtag....

Always keep the 80/20rule!...

Use first person plural when talking

about your company brand (we,us)

Write a general-purpose program with loop and indexed addressing that adds 12h to 0th, 3rd , 7th , 11th ,15th ,19th , … elements of a DWORD array. For example, in array:

Answers

Answer:

def ishex(mylist):

   hnum = 0x12

   for index, item in enumerate(mylist):

       if int(str(item), 16):

           if index == 0:

               print(hex(item + hnum))

           elif item in mylist[3::4]:

               print(hex(item + hnum))

           else:

               print(hex(item))

Dword = [0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f]

ishex(Dword)

Explanation:

The python source code defines a function called "ishex" which takes a list as its parameter, loops through its index and value, checks if it is a hexadecimal number and adds 0x12 to every fourth index value of the list "Dword".

Should Manufacturers Include Extra Programs in Operating Systems for Computers and Mobile Devices?

Answers

Answer:

Well, it depends. Sometimes the extra programs can be useful or just plain fun, in which case the answer is yes. But extra programs can also sometimes be utterly useless and get in the way, in which case the answer is no.\

The development of software for computers benefits greatly from an operating system.

What is operating systems?

Without an operating system, each program would have to contain both its own user interface (UI) and the complete code required to manage all low-level computer operations, such as disk storage, network connections, and other things.

This would greatly increase the size of any application and render software development difficult given the wide variety of underlying hardware available.

Instead, a lot of routine operations, such transmitting a network packet or showing text on a display or other conventional output device, can be delegated to system software, which acts as a bridge between applications and hardware.

Applications can interact with the system in a predictable and consistent manner thanks to the system software.

Therefore, The development of software for computers benefits greatly from an operating system.

To learn more about operating system, refer to the link:

https://brainly.com/question/6689423

#SPJ2

Consider a processor with a 2 ns clock cycle, a miss penalty of 20 clock cycles, a miss rate of 0.05 misses per instruction, and a cache access time (hit time) of 1 clock cycle. Assume that the read and write miss penalties are the same.

a. Find the average memory access time (AMAT).
b. Suppose we can improve the miss rate to 0.03 misses per instruction by doubling the cache size. However, this causes the cache access time to increase to 1.2 cycles. Using the AMAT as a metric, determine if this is a good trade-off.
c. If the cache access time determines the processor’s clock cycle time, which is often the case, AMAT may not correctly indicate whether one cache organization is better than another. If the processor’s clock cycle time must be changed to match that of a cache, is this a good tradeoff?

Assume that the processors in part (a) and (b) are identical, except for the clock rate and the cache miss rate. Assume 1.5 references per instruction (for both I-cache and D-cache) and a CPI without cache misses of 2. The miss penalty is 20 cycles for both processors.

Answers

Answer:

a) 4 ns

b) 3.6 ns

Explanation:

Given that

Miss penalty = 20 * 2

Miss rate = 0.05

Clock cycle = 2 ns

Hit time = 1 * 2

The Average Memory Access Time or AMAT is found by using this formula

AMAT = Hit time + Miss rate × Miss penalty

Substituting directly for the values, we get

AMAT = 2 + [0.05 * (20 * 2 ns)]

AMAT = 2 + (0.05 * 40)

AMAT = 2 + 2

AMAT = 4 ns

b) given that

Miss rate = 0.03

Hit time = 1.2 * 2

Miss penalty remains the same = 40

AMAT = (1.2 * 2) ns + [0.03 * 40] ns

AMAT = 2.4 ns + 1.2 ns

AMAT = 3.6 ns

Considering that the AMAT is 3.6, we can say that it is a good trade-off.

c) CPU time = Clock cycle * IC * (CPIideal-cache + cache stall cycles per instruction)

CPU time

(a) = 2 ns * IC * (2 + 1.5 * 20 * 0.05) =

CPU time = 2 * IC * (2 + 1.5)

CPU time = 2 * IC * 3.5

CPU time = 7 * IC

(b)

CPU time = 2.4 ns * IC * (2 + 1.5 * 20 * 0.03)

CPU time = 2.4 * IC * (2 + 0.9)

CPU time = 2.4 * IC * 2.9

CPU time = 6.96 * IC

The CPU times we calculated in parts (a) and (b) are nearly the same. Thus, we can conclude that, doubling the cache size to improve the miss rate at the expense of stretching the clock cycle results in virtually no net gain.

Most C++ catastrophe vulnerabilities rely on uninitialized function pointers in a class.

a. True
b. False

Answers

Answer:

This is true

Explanation:

please choose the correct option please tell fast​

Answers

it might be bottom left

The ______ of a function take(s) information into the function from the calling program. Group of answer choices prototype local variables arguments purpose parameters

Answers

Answer:

The __arguments ____ of a function take information into the function from the calling program.

Explanation:

The arguments of a function refer to the information or values that are passed into a function when they are called.  The argument may be assigned by default.  A default argument is automatically assigned by the compiler because the caller of the function does not provide a value for the argument with a default value.

write a 2d array c program that can capture marks of 15 students and display the maximum mark, the sum and average​

Answers

Answer:

#include <stdio.h>  

int MaxMark(int* arr, int size) {

   int maxMark = 0;

   if (size > 0) {

       maxMark = arr[0];

   }

   for (int i = 0; i < size; i++) {

       if (arr[i] > maxMark) {

           maxMark = arr[i];

       }

   }

   return maxMark;

}

int SumMarks(int* arr, int size) {

   int sum = 0;

   for (int i = 0; i < size; i++) {

       sum += arr[i];

   }

   return sum;

}

float AvgMark(int* arr, int size) {

   int sum = SumMarks(arr, size);

   return (float)sum / size;

}

int main()

{

   int student0[] = { 7, 5, 6, 9 };

   int student1[] = { 3, 7, 7 };

   int student2[] = { 2, 8, 6, 1, 6 };

   int* marks[] = { student0, student1, student2 };

   int nrMarks[] = { 4, 3, 5 };

   int nrStudents = sizeof(marks) / sizeof(marks[0]);

   for (int student = 0; student < nrStudents; student++) {              

       printf("Student %d: max=%d, sum=%d, avg=%.1f\n",  

           student,

           MaxMark(marks[student], nrMarks[student]),

           SumMarks(marks[student], nrMarks[student]),

           AvgMark(marks[student], nrMarks[student]));

   }

   return 0;

}

Explanation:

Here is an example using a jagged array. Extend it to 15 students yourself. One weak spot is counting the number of marks, you have to keep it in sync with the array size. This is always a problem in C and would better be solved with a more dynamic data structure.

If you need the marks to be float, you can change the types.

Doctors at a regional hospital access an online database of patient records that is being developed and tested by a conglomerate of health insurance agencies. The database contains records of hundreds of thousands of patients and is regulated by HIPAA restrictions on protected health information (PHI). What kind of cloud deployment is this database?

Answers

Answer:

This seems to be DBaaS, in other words, Database, implementation mostly as a service cloud. A further explanation is given below.

Explanation:

DBaaS seems to be a framework for cloud storage that enable participants to choose a standard collection of abstractions to provide, maintain, consume, customize, as well as run databases. Everything just allows consumers with either a treatment process that leads to a database but without specific system configuration, software installation, or performance configuration. Doctors didn't require any database built on certain machines in this situation, because of being able to view every data electronically. Doctors would not have to do database management here since the phone company will require control of it. Accessing the documents what they'd have to do. Any further rights can be obtained through proper permits, such as data upgrading respectively.

How can we work together to fix problems with our websites?

Answers

i think this is or what hihi

Explanation:

The value proposition, or mission statement, tells the visitor what you do and why you do it.

Put your value proposition on your home page, in your headline if possible. Add it to your blog or about page. Let the visitors know exactly what they will be getting if they hire you, buy your product, subscribe to your newsletter or read your blog.

Why are there problems with patching electronics such as heart rate monitors and MRI machines that run embedded Windows OSs?

Answers

Answer:

The various problems with patching electronics such as heart rate monitors and MRI machines that run embedded Windows OSs is that they have a certification which is usually at a specific revision level.

Another issue is that probably the maker or the manufacturer didn’t provide the patch method which would have been used to fix such electronics.

Which element in the script is used to provide guidance for actors regarding a character’s attitude, tone or intent?

Answers

Answer:

Action

Explanation:

Action is one of the script element that describes the tone, pace, sight, and deep feelings or experiences of a script.

In other words, it guides the actors on which of his or her character's attitude, tone, or intent can be seen or heard. Through the Action element, the scene is defined based on how it should make the audience feel through the actors.

Answer:

Parenthetical

Explanation:

that is the real answer, mark as brainliest please.

my assignment was in iCEV, if you have this class, you got it right

Write an expression that executes the loop while the user enters a number greater than or equal to 0.

Answers

num = 1

while num >= 0:

   num = int(input("Enter a number greater than or equal to 0: "))

I hope this helps!

_________________ schedules the processor giving preference to the job with the shortest execution time.

Answers

Answer:

SJF

Explanation:

SJF is an acronym for the word, Shortest Job First. It is a scheduling algorithm that dies exactly what the question asked i.e, scheduling the processors by giving a much higher preference to jobs that posses the most little, or the shortest time of execution. It also brings down the usual waiting time for other processes that are for whatever reasons, yet to be executed.

Software that is decided to intentionally causing harm to a device, server, or network is 
a. Outware
b. Loggerware
c. Attackware
d. Malware

Answers

It's D, so it's Malware

The answer is D for Plato

What is output?

C = 1
Sum = 0
while (c less than 10):
C = c + 3
sum = sum + c
print (sum)

Answers

Answer:

The output of code will be 10

Explanation:

We need to find output of following code:

C = 1

Sum = 0

while (c less than 10):

C = c + 3

sum = sum + c

print (sum)

Solution:

We will check the condition of while loop, if the condition is true, then the statements inside the loop will be executed. Since brackets are not available so, only one statement is linked with while loop.

First while loop will be executed c < 10 (1<10) the condition becomes true, and statement c=c+3 will be executed ( 4=1+3) and then loop condition will be checked (4<10) the condition becomes true, and statement c=c+3 will be executed ( 7=4+3) and then loop condition will be checked (7<10) the condition becomes true and statement c=c+3 will be executed ( 10=7+3) and then loop condition will be checked (10<10) the condition becomes false, so we will come outside loop body and execute: sum=sum+c (10=0+10) and print sum i. e 10

So, The output of code will be 10

In an array-based implementation of a dictionary, if you represent the entries as an array of objects that encapsulate each search key and corresponding value, how many pointers will you use per array entry?

a. 3
b. 4
c. 2
d. 1

Answers

Answer:

The answer is "Option C".

Explanation:

Dictionary is a set of unsorted data values, that is used to save data like a map and which contains a key: value pair in comparison to many other types of data, which only carry a specific number as just an element.

If we use Dictionary as an array so, it uses a two-pointer variable, one for hold key, and the second is used to hold its value.

Which software application should be used when preparing a budget?

Email
Presentation
Spreadsheet
Word processing

Answers

Answer:

i would say presentation

Explanation:

I would say spreadsheet or Email most likely Spreadsheet

Which of the following storage devices are portable? Check all of the boxes that apply.

internal hard drive
external hard drive
flash drive
CD and DVD

Answers

Answer:

Flash Drive, External Hard Drive, and a CD and DVD.

thank god whoever made these questions didn't ask you about a floppy

Answer:

The portable devices are:

External Hard Drive

Flash Drive

CD and DVD

Explanation:

Portable devices are those devices that can be moved with ease from one place to another.

Let us look at the devices one by one

Internal Hard Drive

As internal hard drive is fixed inside the system unit of the computer it cannot be moved easily. So internal hard drive is not portable.

External hard drive, Flash drive, CD and DVD are portable as they are not fixed and are compact in size so they can be moved easily.

Hence,

The portable devices are:

External Hard Drive

Flash Drive

CD and DVD

PYTHON:Given the dictionary, d, find the largest key in the dictionary and associate the corresponding value with the variable val_of_max. For example, given the dictionary {5:3, 4:1, 12:2}, 2 would be associated with val_of_max. Assume d is not empty.

Answers

di = {5: 3, 4: 1, 12: 2}

val_of_max = di[max(di)]

print(val_of_max)

I hope this helps!

Given the IPv4 address in CIDR notation 215.200.110.50/25, identify the subnet IDs.
a. 215.200.110.00, 215.200.110.128
b. 215.200.110.128, 192.200.110.256
c. 215.200.110.00, 215.200.110.64, 215.200.110.128, 215.200.128.19
d. 215.200.110.00, 215.200.110.01, 215.200.110.20, 215.200.128.30

Answers

Answer:

c. 215.200.110.00, 215.200.110.64, 215.200.110.128, 215.200.128.19

Explanation:

IP Address: 215.200.110.50

The first process is to convert all octets to binary individually.

215 to binary

i.e. to divide by 2 as follows:

NOTE:

rem means (remainder)

215/2 = 107 rem 1

107/2 = 53 rem 1

53/2 = 26 rem 1

26/2 = 13 rem 0

13/2 = 6 rem1

6/2 = 3 rem 0

3/2 = 1 rem 1

1/2 = 0 rem1

Then count the remainders from down to up:

So, 215 of decimal is 11010111 in binary

Converting 200 to binary, we divide 200 by 2 until the quotient is 0

200/2 = 100 rem 0

100/2 = 50 rem 0

50/2 = 25 rem 0

25/2 = 12 rem is 1

12/2 = 6 rem 0

6/2 = 3 rem 0

3/2 = 1 rem 1

1/2 = 0 rem 1

Then count the remainders from down to up:

So, 200 of the decimal is 11001000 in binary

Converting 110 to binary; we divide 110 by 2 until the quotient is 0

110/2 = 55 rem 0

55/2 = 27 rem 1

27/2 = 13 rem 1

13/2 = 6 rem 1

6/2 = 3 rem 0

3/2 = 1 rem 1

1/2 = 0 rem 1

Then count the remainders from down to up:

So, 110 of the decimal is 1101110 in binary

In binary,110 = 01101110

We divide 50 by 2 until the quotient is 0

50/2 = 25 rem 0

25/2 = 12 rem 1

12/2 = 6 rem 0

6/2 = 3 rem 0

3/2 = 1 rem 1

1/2 = 0 rem 1

Then count the remainders from down to up:

So, 50 of the decimal is 110010 in binary

To determine the network ID, we keep the first 25 bits of 11010111.11001000.01101110.00110010 and locked all remaining bits to 0.

Thus, network ID in binary is 11010111.11001000.01101110.00000000

Therefore;

11010111.11001000.01101110.00000000 as a decimal notation = 215.200.110.50

Thus, the four subnet IDs are:

11010111.11001000.01101110.00000000 ⇒ 215.200.110.0 0

11010111.11001000.01101110.01000000 ⇒ 215.200.110.64

11010111.11001000.01101110.10000000 ⇒ 215.200.110.128

11010111.11001000.01101110.11000000 ⇒ 215.200.128.19

what is website and what are the difference between website and blog pls anyone​

Answers

A website is a site that contains information for the readers while a blog goes towards followers or viewers
A website contains information or someone’s opinion on a certain topic.

The difference between a website and a blog is that a blog is based on someone’s thoughts or an experience on something or someone. On the other hand, A website is information or a opinion.

Question #5
How does the computer decide which path to follow in a selection control structure?

Answers

Answer:

to answer your question in my thoughts the material of the coding structure helps the software or the cpu translate or guide the programming  .

Explanation:

Selection control structures describes the series of clearly defined rules or guidelines used to establish the decision a computer is expected to make .

Control structures may be conditionals which are executed based on a on a given condition which translates into a True or False values called booleans

These boolean values helps in decision making based on output obtained and thus defining the path to follow.

Therefore, the control structures are of huge importance in defining the sequence which is followed by the computer.

Learn more :https://brainly.com/question/20194760

1. find the network address for 172.22.49.252/17

2. find the last valid assignable host address on the network that host 172.22.4.129 with mask 255.255.255.192 is a part of

3.find the first and last address of the subnet containing 192.167.25.25/16

4.what is the broadcast address of 10.75.96.0/20?

Answers

Answer:

1. The network address for 172.22.49.252/17 is 172.22.0.0/17.

2. The last valid assignable host address of 172.22.4.129/26 is 172.22.4.190.

3. The first and last host address of 192.167.25.25/16 is 192.167.0.1 and 192.167.255.254.

4. The broadcast address of 10.75.96.0/20 is 10.75.111.255

Explanation:

Subnetting in networking is the process of managing the use of host addresses and subnet masks of a network IP address. For example, the IP address "172.22.49.252/17" is a class B address that receives an extra bit from the third octet which changes its subnet-mask from "255.255.0.0" to "255.255.128.0". with this, only 32766 IP addresses are used, with the network address of "172.22.0.0/17".

How does the OS used and the specific applications on the system impact selection of a file management system?

Answers

Answer:

Explanation:

The functions of a file manager include the following.

The ability to format and copy disks

Listing of files in a storage channel.

A regular routine check of space used and unused space in the storage device.

The ability to organize, copy, move, delete, sort, or create shortcuts.

Storage and retrieval of data for the storage device. etc

In contrast, the system has some of the following functions.

Assigning queued document numbers for processing- Applications and Operating system dependent

Owner and process mapping to track various stages of processing - Operating system dependent

Report generation - Applications and Operating system dependent

Status - Operating system dependent

Create, modify, copy, delete, and other file operations - Operating system dependent

We can thereby conclude that file management system is dependent on OS and specific applications.

Which of the following software costs money?

A.Google Docs
B. OpenOffice Writer
C.Word Online
D. Word 2013
Help pls
Award: 15pts

Answers

Answer:

I think it’s Word 2013

Explanation:

How many times does a loop with the header for count in range(10): execute the statements in its body?a. 9 timesb. 10 timesc. 11 times

Answers

Answer:

10 times

Explanation:

Given

for count in range(10):

Required

Number of execution times

The given code snippet is in python

Python initializes its iteration to 0 and stops at the maximum range - 1

In this case, the loop starts at 0 and ends at 10 - 1 i.e. 9

So, the possible values of count variable are: 0,1,2,3,4,5,6,7,8,9

i.e 10 possible values

Hence, the loop will be executed 10 times

Who still plays old Nintendo 64 games?

Answers

Answer:

I play Nintendo 64 games when I was young. I use to love playing Mario 64 as well.

Answer:

Explanation: i kinda but not that much i havent played in a long time

A UI text element must be added to ______.an empty background container game objecta prefaba slot game objecta tray objecta canvas

Answers

Answer:

canvas

Explanation:

The answer to this question is that A UI text element must be added to a canvas. The canvas is that area that all the unity items (UI) have to be inside.

We insert the Text UI element when we move to the hierarchy of the scene from create we move to UI and then to text.

After all these have been done, we will get a text element which have been added in the Canvas region.

is third wave of globalization theoretical discourse

Answers

Answer:

yes..,....................................

Explanation:

...

Other Questions
Write an equation in slope intercept form for the line that passes through (5, -4) and is perpendicular to the line described by 2x-10y=0 Why did the barons write the Magna Carta, and how did it affect the power of the king? Salvatore purchased several magazines for $2 each and books for $3 each. If he spent $160 on a total of 60 books and magazines altogether, what would be the number magazines that Salvatore purchased? can someone help me Function f(x) represents the population of bacteria x hours after 9 a.m. What does F(2)-F(1) represent? help plz help plz help heya! ^^Help me [tex] \boxed{ \large{ \sf{Question: }}}[/tex]Five years ago,A's age was four times the age of B. A's age will be twice of the age of B. Find their present ages._______________________best of luck ^^ plz, help me plz this is the only question I have plz answer plz!!!!!!!!!!!!!!!!!!!!!!!!!!!!List three ways that music is used in modern society. Comparing your performance in this workout to how you did in the last Yoga workout (4 weeks ago); how did you do? (full sentence response) * Matthew made a fruit salad, in which the ratio of blueberries to red grapes is 8:6. Write the ratio of red grapes to blueberries in simplest form. [Type your ratio using a colon and without spaces.] can I have help I would deeply appreciate it Which of the following sentences does NOT use slang?We were dragging at school after being up all night studying.That comedy was a scream.The family was thrilled to be going on a cruise together.The trip to Walt Disney World was totally awesome! In 8 days, the temperature dropped 12 degrees. If the temperature changed at the same rate for all the days what was the change in temperature per day? What is the exact product of 1.5 3.24 Read the passage from "The Legend of Arthur and the Swords. "Yes, my king, Bedivere lied. "I have thrown your sword into the lake. Arthur looked into the knights eyes. "Tell me what you saw, he said. "I saw nothing but the water as it rippled, answered the knight. What story element does every sentence from the passage contain? Specific keys that each finger is responsible for typing is called A. ergonomics B. Touch typing C. Key reaches D. Posture ASAP When applying technology to identify text disagreement, what is a keyword? a word that provides the answers to different questions that are in the texts a word that shows the importance of disagreeing on facts a word that provides the facts that are different between texts a word that shows sources that offer more information about the point on which the texts differ Explain how Indian civilization fared under the Gupta dynasty. A farming technique used by a local farmer unexpectedly inhibits the absorption of oxygen through the roots of her potatoes. Which farming technique did she likely use? Flood irrigation Furrow farming Nitrate fertilizing Spray fertilizers which of these is true about the total amount of energy in a closed system? Decreases Destroyed and created Increases Remains the same