1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
TEA [102]
2 years ago
13

Write an algorithm to print the odd number from 100 to 1​

Computers and Technology
1 answer:
stiks02 [169]2 years ago
3 0

Answer:

In python:

for x in range(0,100):

   if x % 2 == 1:

       print(x)

You might be interested in
g The reciprocal Fibonacci constant ψ is defined by the infinite sum: ψ=∑n=1 [infinity] 1 Fn Where Fn are the Fibonacci numbers
timama [110]

Answer:

see explaination

Explanation:

MATLAB script:

% MATLAB script that calculates reciprocal Fibonacci constant Ψ

% Initial Values

a0 = 1;

a1 = 1;

% Looping variable

i = 2;

% Reading n value from user

n = input(' Enter n value: ');

% Initializing sum

sum = (1/a0) + (1/a1);

% Loop till i reaches n value

while i <= n

% Finding term in Fibnocii series

a2 = a0 + a1;

% Accumulating Sum

sum = sum + (1/a2);

% Updating previous terms

a0 = a1;

a1 = a2;

% Incrementing loop variable

i = i + 1;

endwhile

% Printing result

printf("\n Reciprocol Fibnocii Constant: %f \n", sum);

See attachment for sample output

5 0
3 years ago
Software that displays advertising material when online.
liubo4ka [24]

Answer:

adware

Explanation:

Adware is a software that shows ads etc online, but also sometimes on the desktop.

Advertisware is not a real term, this is to throw you off.

Sellware is a website not a type of software

8 0
3 years ago
Read 2 more answers
Consider the following general code for allowing access to a resource:
Margaret [11]

Answer:

a) The code allows access even when  IsAccessAllowed(...) method fails.

b) Either use If

(dwRet = ACCESS_ALLOWED)

or use

if (dwRet == NO_ERROR)

to avoid flaw

Explanation:

Lets first see what the code chunk does:

DWORD dwRet = IsAccessAllowed(...);

if (dwRet == ERROR_ACCESS_DENIED) {

// Security check failed.

// Inform user that access is denied.

} else {

// Security check OK.

}

In the given code, DWORD is basically a data type for double word type integers and this is defined in windows.h

So there is DWORD type variable dwRet that is assigned a method calls.

The method is IsAccessAllowed() which checks if the access is allowed to user.

if (dwRet == ERROR_ACCESS_DENIED) condition basically checks if the value of DWORD type variable dwRet is equal to ERROR_ACCESS_DENIED

If this condition evaluates to true then the security checks fails and user is informed via some message or action that the access is denied.  But when the if condition evaluates to false then the else part executes which allows access.

So basically this chunk of code checks if the error ERROR_ACCESS_DENIED is returned.

Now the flaw in this program is what if the method IsAccessAllowed() by any reason. The reasons can be system failure or the memory failure. In memory failure case for example, the system returns out of memory error. So this means that the error is not  ERROR_ACCESS_DENIED. Instead it is out of memory error. So in such a case the user is allowed access as the if condition evaluates to false and else part executes. So if any other error is produced due to some reason like mentioned above, then user has unrestricted access.

This shows that the doe should not check for the failure or rely on checking ERROR_ACCESS_DENIED to allow access but instead it should check for success. Code should only give access privilege if access is allowed successfully or no error is produced.

So to avoid this flaw the code is altered as:

DWORD dwRet = IsAccessAllowed(...);

If (dwRet = ACCESS_ALLOWED) {

//Security check OK.

} else {

//Security check failed.

//Inform user that access is denied.

}

This will only allow access if ACCESS_ALLOWED evaluates to true and success is checked instead of failure here

You can also alter the if condition as:

If (dwRet = No_Error)

or

If (dwRet = 0)

The above if conditions checks if the access is allowed or if no error is produced. Only then it will allowed access otherwise not. So the access check is a success is checked first and failure (for any reason). The user is allowed access only if there is no error otherwise user is not allowed access.

6 0
3 years ago
Which kind of device is hardware capable of transferring items from computers and devices to transmission media and vice versa?
Mekhanik [1.2K]
Would it be a flash drive?
7 0
3 years ago
A college team's BCS football ranking is comprised of three elements:1) the Harris Poll score, 2) the Coaches Poll score, and 3)
artcher [175]

Answer:

harris_poll_ranking = int(input("Enter team's Harris Poll ranking [1 - 2,850]: "))

coaches_poll_ranking = int(input("Enter team's Coaches Poll ranking [1 - 1,475]: "))

computer_ranking  = float(input("Enter team's computer ranking  [0 - 1]: "))

harris_poll_score = harris_poll_ranking / 2850

coaches_poll_score = coaches_poll_ranking / 1475

bcs_score = harris_poll_score / 3 + coaches_poll_score / 3 + computer_ranking / 3

print(bcs_score)

Explanation:

*The code is in Python.

Ask the user to enter the  harris_poll_ranking as int, coaches_poll_ranking as int and computer_ranking as float

Calculate the harris_poll_score, divide the harris_poll_ranking by 2850

Calculate the coaches_poll_score, divide the coaches_poll_ranking by 1475

Calculate the bcs_score, harris_poll_score, coaches_poll_score and computer_ranking by 3 and sum them

Print the bcs_score

6 0
3 years ago
Other questions:
  • The fractional_part function divides the numerator by the denominator, and returns just the fractional part (a number between 0
    8·1 answer
  • What are the differences between levels 1, 2 and 3 cache memoroes??
    8·1 answer
  • Consider sorting n numbers stored in array A by first finding the smallest element of A and exchanging it with the element in A[
    13·1 answer
  • The ____ cell on the worksheet is the one into which you can enter data.â
    15·2 answers
  • Write a program that prompts the user for their quarterly water bill for the last four quarters. The program should find and out
    5·1 answer
  • Que funcion tiene la sombrilla forrada de aluminio​
    6·1 answer
  • Please help me
    10·1 answer
  • Name three types of hard drives, along with its speed and size.
    8·1 answer
  • Courses that enable students to begin jobs that require course completion certificates are know as
    8·1 answer
  • The linear programming ingredient or blending problem model allows one to include not only the cost of the resource, but also th
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!