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
Sholpan [36]
3 years ago
14

Write a do-while loop that continues to prompt a user to enter a number less than 100, until the entered number is actually less

than 100. end each prompt with newline. ex: for the user input 123, 395, 25, the expected output is: enter a number (<100: enter a number (<100: enter a number (<100: your number < 100 is: 25
Computers and Technology
1 answer:
worty [1.4K]3 years ago
4 0
Here's a solution in plain C:

int num;
do { printf("enter a number (<100)\n"); scanf_s("%d", &num, sizeof(num)); } while (num >= 100);
printf("your number <100 is %d", num);

Note that this solution has flaws. It is unclear what should happen when the user types a negative number or a floating point number. Also it doesn't handle incorrect input (e.g., "aaa") at all.

But you get the idea.
You might be interested in
A company is experiencing overwhelming visits to a main web server. The IT department is developing a plan to add a couple more
Varvara68 [4.7K]
The answer is C) Availability.

Although the company is addressing scalability by adding more servers, the question is asking for security requirement. Therefore we need to choose one of the principles from CIA triad which includes confidentiality, integrity, and availability.

Integrity involves keeping the data accurate and confidentiality involves keeping the data between the sender and intended recipient(s). That being said, scalability and availability are the possible answers.

C) Availability is the best answer because it is part of the CIA triad.

Note: Another resource to look at for cyber security principles would be the Parkerian Hexad.
5 0
2 years ago
Read 2 more answers
2 Consider the sequence of keys (5,16,22,45,2,10,18,30,50,12,1). Draw the result of inserting entries with these keys (in the gi
Juliette [100K]

Answer:

A) (2,4) tree

  • Insertion of  key 45 makes key unbalanced and this is because it violates the 2,4 tree so we split the node
  • insertion of key 10 makes key unbalanced and this is because it violates the 2,4 tree so we split the node

B) Red-black tree

Explanation:

The diagrams for the solutions are attached showing the results of inserting entries

6 0
3 years ago
Write a complete program that declares an integer variable, reads a value from the keyboard into that variable, and writes to st
Feliz [49]

Answer:

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

  // variables

  double num;

  // read discriminant

  cin>>num;

  // calculate square of the input

  double result=num*num;

  // print the square number

  cout<<result<<endl;

     return 0;

}

Explanation:

Declare a variable "num".Read the value of "num" from keybord.Then calculate square of the input number.Print the square of input number.

Output:

5

25

5 0
3 years ago
Using the college registration example from section 6.7.3 as a starting point, do the following:
Arada [10]

Answer:

Explanation:

NCLUDE Irvine32.inc

TRUE = 1

FALSE = 0

.data

gradeAverage WORD ?

credits WORD ?

oKToRegister BYTE ?

str1 BYTE "Error: Credits must be between 1 and 30" , 0dh,0ah,0

main PROC

call CheckRegs

exit

main ENDP

CheckRegs PROC

push edx

mov OkToRegister,FALSE

; Check credits for valid range 1-30

cmp credits,1 ; credits < 1?

jb E1

cmp credits,30 ; credits > 30?

ja E1

jmp L1 ; credits are ok

; Display error message: credits out of range

E1:

mov edx,OFFSET str1

call WriteString

jmp L4

L1:

cmp gradeAverage,350 ; if gradeAverage > 350

jna L2

mov OkToRegister,TRUE ; OkToRegister = TRUE

jmp L4

L2:

cmp gradeAverage,250 ; elseif gradeAverage > 250

jna L3

cmp credits,16 ; && credits <= 16

jnbe L3

mov OkToRegister,TRUE ; OKToRegister = TRUE

jmp L4

L3:

cmp credits,12 ; elseif credits <= 12

ja L4

mov OkToRegister,TRUE ; OKToRegister = TRUE

L4:

pop edx ; endif

ret

CheckRegs ENDP

END main

8 0
3 years ago
What is the most complex part of a PC?
rjkz [21]

Answer:

From a hardware standpoint, the CPU is most likely the main component. From a software standpoint, macOS and Windows are complex software systems.

Explanation:

6 0
2 years ago
Other questions:
  • Randy is concerned about his company’s data security on the Internet. Because cellular signals are not encrypted, he is concerne
    6·1 answer
  • Ask the user to enter a number n &gt;= 1. There after the user will enter n-1 distinct integers between 1 and n. Thus, the enter
    9·1 answer
  • In general terms, a program that is broken into smaller units of code such as methods, is known as a ________
    6·1 answer
  • Consider a movie database in which data is recorded about the movie industry. the data requirements are summarized as follows:
    15·1 answer
  • Write the definition of a function max that has three int parameters and returns the largest.
    6·2 answers
  • Your organization's network has multiple layers of security devices. When you attempt to connect to a service on the Internet. H
    9·1 answer
  • Do you think I could create a working animatronic like the one from five nights at freddys
    12·2 answers
  • Why is simplicity important in navigation design?
    13·1 answer
  • You are given a graph G = (V, E) with positive edge weights, and a minimum spanning tree T = (V, E’) with respect to these weigh
    14·1 answer
  • Select one Layer 2 or wireless WAN technology presented in Lesson 3. Elaborate on its characteristics, pros and cons, and common
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!