Write a program that calculates the occupancy rate for each floor of a hotel. The program should start by asking for the number of floors the hotel has. A loop should then iterate once for each floor. During each iteration, the loop should ask the user for the number of rooms on the floor, and how many of them are occupied. After all the iterations, the program should display the number of rooms the hotel has, the number that are occupied, the number that are vacant, and the occupancy rate for the hotel. Input Validation: Do not accept a value less than 1 for the number of floors. Do not accept a number less than 10 for the number of rooms on a floor.

Answers

Answer 1

Answer:

# User is prompted to enter the number of floor in hotel

# The received value is assigned to no_of_floor

no_of_floor = int(input("Enter the number of floor in the hotel."))

# This loop is to enforce that user input is not less than 1

while (no_of_floor < 1):

   no_of_floor = int(input("Enter the number of floor in the hotel."))

# counter variable is initialized to loop through the no_of_floor

counter = 1

# total number of rooms occupied in the hotel is initialized to 0

total_occupied = 0

# total number of rooms vacant in the hotel is initialized to 0

total_vacant = 0

# total number of rooms in the hotel is initialized to 0

total_room = 0

# loop through each floor

while counter <= no_of_floor:

   # number of room in a floor is received from user

   number_of_room = int(input("Enter the number of room in floor: "))

   # this loop ensure that the number must not be less than 10

   while (number_of_room < 10):

       number_of_room = int(input("Enter the number of room in floor "))

   # number of occupied room is a floor is accepted from user

   number_of_occupied = int(input("Enter the number of occupied room."))

   # this loop ensure that the no_of_occupied is less than no_of_room

   while (number_of_occupied > number_of_room):    

       number_of_occupied = int(input("Enter the number of occupied room."))

   

   # number of vacant room in a floor is calculated

   floor_vacant = number_of_room - number_of_occupied

   # total number of occupied room is calculated

   total_occupied += number_of_occupied

   # total room in the hotel is calculated

   total_room += number_of_room

   # total number of vacant room is calculated

   total_vacant += floor_vacant

   # the counter is increment to move to the next floor

   counter += 1

# occupancy_rate is calculated as a percentage

occupancy_rate = (total_occupied / total_room) * 100

# Number of total room is displayed

print("The total number of room in the hotel is: ", total_room)    

# Number of total vacant room is displayed

print("The number of vacant room in the hotel is: ", total_vacant)

# Number of total occupied room is displayed

print("The total number of occupied room in the hotel is: ", total_occupied)

# The occupancy rate for the hotel is displayed to 2 decimal

#  place percent

print("The occupancy rate for the hotel is: {:.2f}%".format(occupancy_rate))

Explanation:

The program is well commented. It put all the constraint into consideration like:

not allowing a user to enter less than 1 for number of floorsnot allowing a user to enter less than 10 for number of rooms in a floornot allowing a user to enter number of occupied room greater than number of room in a floor.

Related Questions

Which of the following types of cloud platforms would a webmail service offered to the general public be considered?
1. SaaS2. IaaS3. PaaS4. MaaS

Answers

Answer:

1. SaaS

Explanation:

Cloud computing is a platform that provides online server services for an individual or a group of clients. The cloud computing services are of four types, namely, SaaS (software as a service), IaaS (infrastructure as a service), PaaS (platform as a service) and MaaS (mobility as a service).

The SaaS is used by web or email services, where the server sends or loads the application data to the client, and all data can be viewed and modified on the copy of the data sent to the client.

Write a statement that assigns finalResult with firstSample plus secondSample, divided by 3. Ex: If firstSample is 18 and secondSample is 12, finalResult is 10.

Answers

Answer:

finalResult=(firstSample+secondSample)/3;  //coded inc++

Explanation:

The above code is executed in c++. As it involves basic arithmetic, so, if whole program has to be written,then they can be declared of type int,float or double as required and then the above statement must be used in which firstSample and secondSample has been added first and the result is divided by 3 to obtain the desired output.

How do Salesforce enforce data access using role hierarchy? A. Users are given access to the records owned by the users who are below the role hierarchy. B. Users are given access to the records owned by the users who share the same role on the role hierarchy. C. Users are given access to the records accessible by the users who are below the role hierarchy. D. Users are given access to the records accessible by the users who are above the role hierarchy.

Answers

C. Users are given access to the records accessible by the users who are below the role hierarchy.

The owner and system admin normally has the super user account, then they would assign roles and hierarchy to each department heads and members which roles and modules are lower type of user access compared to them.

which of the following control types would backup of server data provide in case of a system issue?
A.)Corrective

B.)Deterrent

C.)Preventive

D.)Detective

Answers

Answer:

B.) Deterrent

Explanation:

Final answer:

Backup of server data provides a Corrective control in the case of a system issue, being used to restore systems to their previous state after a problem has occurred.

Explanation:

The type of control that backup of server data provides in case of a system issue is Corrective. This is because backups are used to restore data and systems to their last known good state after an adverse event has occurred, correcting the impact of the event.

Backups do not prevent issues from happening, nor do they deter potential problems; their main purpose is to correct the state of the system after an issue has happened. They also do not typically detect issues, as their role is primarily focused on recovery.

It's important to note that organizations often develop a Corrective and Preventative Action plan to manage potential issues identified through processes like Statistical Process Control discussed in class.

If you reformat the hard drive on a computer, it erases all personal information from your computer and makes it safe to donate. True False

Answers

The answer would be false

Systena Solutions Inc. contracts Anenta Software Inc. to develop advanced anti-malware software. In order to serve its new customer better, Anenta Software Inc. sets up a dedicated customer service team exclusively for Systena Software. This is an example of _____ customer service.

Answers

This is an example of b2b customer service.

Explanation:

B2b customer service is the customer service which stands for business to business. It refers to the sale that you make to the business instead of an individual consumers.

B2b customer experiences include creating a personalized. omni channel experience and building lasting relationships while providing convenient, digital solutions.

When writing test methods, what functionality is verified by the system method "runAs()"?

Answers

Answer:

The main functionality verified by this test method command is user sharing record.

Explanation:

Generally, every apex code runs in system mode.

Apex is strong object-oriented programming language that allows the developers to execute flow and transaction control.

Using syntax which look like java and acts as databases, Apex allows the developer to add any type of business logics to an event which can include button, clicks records or visual pages.

Apex code can be initiated by web service request.  

The permissions and record sharing of current user are not consider by apex codes.

Now the system method runAs() will allow you to take or write a test method which will basically change the user context to an existing or an new user, so that the record sharing will take place.

runAs() command will not change or anything done with user permissions or permission levels, it will only record sharing of the user.  

When you use runAs() command the original and true context will run after the test method is once completed under the command of runAs().

The runAs() has no concern with the user license.  

If there is no or expired your personal or organization license you can just make a new user with this runAS() command.

In using this command we have to make a private class by the name of this test and then our further code to make a user , afterwards  which we will the true and original code of ours which we want to run.

There are many other uses of runAs() like  

 Mixed DML operations in test by opening the DML operations.

 We can also use it as a version which will take a package as a version argument. This will cause the code a specific version.

runAs(System.Version) is the command used for this.

What is the output of the following program?
int sum = 0; int k = 1; int val = 1; for (k = 0; k <= 8; k++) { sum += val; val++; }
System.out.println(sum);

Answers

Final answer:

The Java program uses a for loop to calculate the sum of the first 9 positive integers. The sum variable is increased by val each loop iteration, while val is incremented by 1. The output of the program is therefore 45.

Explanation:

The student asked about the output of a Java program with a for loop that calculates the summation of numbers. To determine the output, we can trace the loop's execution. Starting with int sum = 0, we enter the for loop, which initializes int k = 0 and will iterate until k is greater than 8. On each iteration, the current value of int val is added to sum, and then val is incremented by 1. Thus, the loop runs 9 times (from k = 0 to k = 8 inclusive) and sums the numbers 1 through 9. We end up with sum equalling the sum of the first 9 positive integers, which is 45. Hence, the output printed to the console is 45.

Object Oriented Programming (OOP) allows us to handle complex code in an organized structure and break down the problem by modelling it in a way that relates to our everyday life. With fast advancement in technology and ever decreasing product cycles, many developers are starting to believe that OOP is not currently being implemented as it was intended to be implemented. They believe that OOP is unnecessarily complicating the problem solving so, OOP should be phased out as the absence of structure is better (in many cases) than having bad structure.

Analyze the above statement very carefully and answer the following:

• Do you believe that OOP should be phased out and we should start working on some alternative(s)? Provide your answer with Yes or No.

• Give your opinion with two solid reasons to support your answer.

Answer just 4 to 5 lines

Answers

No I don't believe that OOP should be phased out.

Explanation:

Reason:

OOPS make things simpleIt promotes inheritance to avoid repetition, abstraction and encapsulation of keeping data secured and wonderful concept of object.OOP is kept as the base for many of the Application development software like Dot Net, Java, etc.The world is running around by objects and and OOP concept is the best possible method to handle those.OOP is an time-tested method and it should not be phased out.

In a dictionary whose keys are the warehouses: associated with each warehouse is an inner dictionary whose keys are the stocked products (and whose associated values are the inventory of that product in the warehouse). The inventory must always be a non-negative value; an inventory of 0 is legal. For example, a simple/small database might be.

db = {'Irvine' : {'brush': 3, 'comb': 2, 'wallet': 2}, 'Newport': {'comb': 7, 'stapler': 0},
'Tustin' : {'keychain': 3, 'pencil': 4, 'wallet': 3}}

This data structure means that

The Irvine warehouse stocks 3 brushes, 2 combs, and 2 wallets.

The Newport warehouse stocks 7 combs, and 0 staplers.

The Tustin warehouse stocks 3 keychains, 4 pencils, and 3 wallets.

(c) The by_store_inventory2 function returns a list of 2-tuples (str,int) (warehouse names and inventory), sorted ascending by which warehouses have the largest inventory (summed over all the products). If two warehouses store the same inventory, they should appear in ascending order of warehouse name: for the db dictionary above the result is [('Irvine', 7), ('Newport', 7), ('Tustin', 10)].

Answers

Answer:

Here is the completed code for this problem. Comments are included, go through it, learn how things work.

Note: Please maintain proper code spacing (indentation), just copy the code part and paste it in your compiler/IDE directly, no modifications required.

Explanation:

#code

#required method taking a db as parameter

def by_product_inventory_count(db):

   #one line statement, which initially creates a list of all keys (warehouse names)

   #from the dict using a list comprehension, then sorts it by length of the inner dict

   #represented by each warehouse name, and if the length is same, sorts by key itself

   #(alphabetically), and returns this sorted list

   return sorted([key for key in db],key=lambda x:(len(db[x]),x))

#creating a db and testing the method

db={'Irvine' : {'brush': 3, 'comb': 2, 'wallet': 2}, 'Newport': {'comb': 7, 'stapler': 0},

'Tustin' : {'keychain': 3, 'pencil': 4, 'wallet': 3}}

sorted_warehouse_names=by_product_inventory_count(db)

print(sorted_warehouse_names)

#OUTPUT

['Newport', 'Irvine', 'Tustin']

If a device is determined to have an out-of-date virus signature file, then Network Access Control (NAC) can redirect that device to a network by __________.

a. a Trojan horse
b. TCP/IP hijacking
c. Address Resolution Protocol (ARP) poisioning
d. DHCP man-in-the-middle

Answers

Answer:

C. Address Resolution Protocol (ARP) poisoning.

Explanation:

An antivirus signature file is a program written to describe and remedy a group of identified malware attacks, to prevent future attacks from the described malicious softwares. It is constantly updated to identify more malicious softwares.

A network access protocol (NAC) is used to implement access control on a network, collaborating with other protocols like ARP and unifying antiviruses, intrusion detection and vulnerability assessment.

When the virus signature file is out of date, the NAC allows a new malware, the antivirus can not identify, to access the network through ARP poisoning.

Find the word-length 2's complement representation of each of the following decimal numbers:a. 845b. 15000c. 100d. -923

Answers

Answer:

(a) 845 = 0000 0011 0100 1101

(b) 1500 = 0011 1010 1001 1000

(c) 100 = 0000 0000 0110 0100

(d) -923 = 1111 1100 0110 0101

Explanation:

NOTES:

First Note: The question requests that the numbers be represented in word-length. That means they should be represented in 16bits (a word is 2 bytes).

Second Note: To convert a number to its 2's complement representation,

(i) if the number is positive, the usual conversion to binary will suffice. You might just need to add zero at the beginning of the sequence of bits to ensure that the leftmost bit is a zero(0).

(ii) if the number is negative, then;

=> convert the magnitude of the number to its binary

=> add zeros to the beginning of the sequence of binary until the sequence has the specified length

=> flip each bit in the sequence and add 1 to the result.

SOLUTION:

Applying the rules in the notes above, lets convert the numbers.

(a) 845 => The number is positive, conversion to its binary will suffice

2  |  845

2  |  422 R 1

2  |  211 R 0

2  |  105 R 1

2  |  52 R 1

2  |  26 R 0

2  |  13 R 0

2  |  6 R 1

2  |  3 R 0

2  |  1 R 1

2  |  0 R 1

Writing the remainders upwards, we have

845 = 1101001101

Pad with zeros to convert it to its word-length representation.

845 = 0000 0011 0100 1101

(b) 15000 => The number is also positive, so following the same step as above,

15000 = 11101010011000

Pad with zeros to convert it to its word-length representation.

15000 = 0011 1010 1001 1000

(c) 100 => The number is also positive, so following the same step as above,

100 = 1100100

Pad with zeros to convert it to its word-length representation.

100 =  0000 0000 0110 0100

(d) -923 => The number is negative;

-->  first convert its magnitude (923) to binary

923 = 1110011011

--> Pad with zeros to convert it to its word-length representation.

923 =  0000 0011 1001 1011

--> Flip the bits

0000 0011 1001 1011 = 1111 1100 0110 0100

--> Add 1 to the result above

1111 1100 0110 0100 + 1 = 1111 1100 0110 0101

Therefore;

-923 = 1111 1100 0110 0101

The word length 2's complement representations are:

a. 845: 001101001101

b. 15000: 0011101101100000

c. 100: 0000000001100100

d. -923: 1111110001000101

We have,

To find the word-length 2's complement representation of each decimal number, we first need to determine the binary representation of the absolute value of the number and then convert it into its 2's complement form if the number is negative.

Assuming the word length is 16 bits:

a. 845:

Binary representation of 845: 0011 0100 1101

Since it is positive, the 16-bit 2's complement representation remains the same: 0011 0100 1101

b. 15000:

Binary representation of 15000: 0011 1011 0110 0000

Since it is positive, the 16-bit 2's complement representation remains the same: 0011 1011 0110 0000

c. 100:

Binary representation of 100: 0000 0000 0110 0100

Since it is positive, the 16-bit 2's complement representation remains the same: 0000 0000 0110 0100

d. -923:

Binary representation of 923: 0000 0011 1011 1011

To find the 16-bit 2's complement representation, we first invert all the bits: 1111 1100 0100 0100

Then, add 1 to the inverted value: 1111 1100 0100 0101

So, the 16-bit 2's complement representation of -923 is: 1111 1100 0100 0101

Thus,

a. 845: 001101001101

b. 15000: 0011101101100000

c. 100: 0000000001100100

d. -923: 1111110001000101

Learn more about complements representations here:

https://brainly.com/question/33566495

#SPJ3

A data _____ is a collection of data from a variety of sources used to support decision-making applications and generate business intelligence

Answers

Answer:

warehouse

Explanation:

A bit similar to a database, a data warehouse is a collection or large store of data from different sources that businesses and organization can use to make intelligent business decisions. The data sources for a data warehouse are typically databases from different vendors and architectures.

Data warehouses are typically data repositories used by organizations for data analysis and reporting purposes.

Final answer:

A data warehouse is a centralized repository that aggregates data from multiple sources to support decision-making applications and generate business intelligence. Evaluating the credibility of these sources and utilizing information technology can greatly enhance the quality and usability of the data.

Explanation:

The blank in the question should be filled with the term data warehouse. A data warehouse is a centralized repository that stores data from multiple sources. This data is often gathered from sources that record, analyze, and interpret primary data, which is critical for generating valuable business intelligence. It's essential to evaluate the credibility of these sources to ensure the data's accuracy and reliability.

Data becomes valuable information once it's put into context, analyzed to answer questions, or used within analytical frameworks. Information technology, particularly computers, greatly facilitates this transformation by automating repetitive tasks, managing data storage efficiently, and providing various tools for data analysis.

Sources of data can be incredibly diverse, ranging from satellites and grocery store scanners to traffic sensors and smartphone apps. These capabilities help businesses and organizations in making strategic decisions and forecasting future trends.

"to store and manage the databases of the client/server system, each server requires what"

Answers

Answer:

A Data Base Management System (DBMS)

Explanation:

Databases refer to organized data collection mostly stored and accessed by computers and other electronic systems/devices. In other to effectively store, retrieve, manipulate/change data items in a database, a software package called a Data Base Management System (DBMS) is required. This software allows the manipulation, retrieval and general management of the data in the database. popular examples of DBMS are MySQL and Microsoft SQL Server. Therefore in a client/server system as stated in the this question, each server will require a DBMS installed to allow interaction with users and other applications, in order to capture, store, and manage data.

How do you move on to another question after you select Grade It Now and read the explanation?

Answers

Answer:

After you select Grade It Now and read the explanation, just click the Grade It Now or Save and Continue button after you’ve answered each question to move on to another question.

Explanation:

Welcome to Aplia different type of questions:

- True or False answers: Not able to redo practice problems after deadline.

- Graded at Deadline problems: Not be able to try a problem again after it is graded.

- Grade It Now problems: you can Save your work and come back to it later, by clicking Save and Continue, you can attempt each problem 3 times.

After clicking the Grade It Now button, you can click on any of the blue bars labeled “Explanation” to see the correct answer.

- Scroll down questions to check all that apply: by clicking the down arrow, pressing the backspace key on the keyboard; using your mouse to drag the scroll bar.

- Fill in blanks questions: completing sentences or entering values into a table.

- Radio button questions and blanks: only one correct answer.

- Checkbox questions: multiple correct statements.

The kings and queens of England are listed in a relation Kings(name,nickname,house,beginReign,endReign). Their name is unique, either using a Roman numeral to distinguish them, e.g., 'Edward I' or 'Edward II', or in a few cases using their nickname, e.g., 'Edward the Confessor'. The attribute nickname is an additional appelation, if they have one and it is not used in their name to distinguish them, e.g., 'The Unready'. The value of nickname is NULL if there is no nickname. The attribute house is the dynasty, e.g., 'Tudor'. Attribute beginReign and endReign are integers, the first and last years, respectively, that the king or queen was on the throne. There is also a relation Parents(child,parent). Both attributes are the names of kings or queens, with the obvious connection that the first is a child of the second. Write the following queries: Who was king in the year 1000? Give the name and nickname. Find all the pairs of kings or queens (A,B) such that A was the great grandchild of B. Find the name and nickname of all kings or queens that have a nickname that does not begin with "The". Find the names of those kings or queens that were the parent of two or more kings or queens. List each such person only once. Find for each house the number of kings or queens of that house. Several times in British history, kings or queens have deposed one another, so that their reigns overlapped. Find all such pairs, listing the pairs in both orders; i.e., list both (A,B) and (B,A). However, be careful not to list pairs A and B where the only overlap is that A's reign ended in the same year that B's began, or vice-versa.

Answers

Answer:

The answers to each question are explained below

Explanation:

Who was king in the year 1000? Give the name and nickname.

Query:

       SELECT name, nickname FROM Kings

      WHERE beginReign <=1000 AND endReign >=1000;

Explanation:

SELECT is used to query the database and get back the specified fields.

name and nickname are columns of Kings table.

FROM is used to query the database and get back the preferred information by specifying the table name.

Kings is a table name.

WHERE is used to specify a condition based on which the data is to be retrieved. The conditions are as follows:

beginReign <=1000

endReign >=1000

AND clause between the conditions indicate that both the conditions must be true.

Find all the pairs of kings or queens (A,B) such that A was the great grandchild of B.

Query:

       SELECT p.child, ggp.parent

       FROM Parents p, Parents gp, Parents ggp

       WHERE p.parent = gp.child AND gp.parent = ggp.child;

Explanation:

SELECT is used to query the database and get back the specified fields.

child is a column of Parents table aliased as p(parent).

parent is a column of Parents table aliased as ggp (great grand father).

FROM is used to query the database and get back the preferred information by specifying the table name.

parents is a table name. Three aliases named p(parent), gp(grand father) and ggp(great grand father) are created.

WHERE is used to specify a condition based on which the data is to be retrieved. The conditions are as follows:

p.parent = gp.child

gp.parent = ggp.child;

AND clause between the conditions indicate that both the conditions must be true.

Find the names of those kings or queens that were the parent of two or more kings or queens. List each such person only once.

Query:

       SELECT parent FROM Parents

       GROUP by parent

       HAVING COUNT(*) > 1;

Explanation:

SELECT is used to query the database and get back the specified fields.

parent is a column of Parents table .

FROM is used to query the database and get back the preferred information by specifying the table name.

parents is a table name.

Group by clause is used to group the data on column parent.

Having clause specifies the condition based on which the data is to be retrieved.

Find for each house the number of kings or queens of that house.

Query:

       SELECT house, COUNT(name)

       FROM Kings

       GROUP by house;

Explanation:

SELECT is used to query the database and get back the specified fields.

house is a column of Kings table .

FROM is used to query the database and get back the preferred information by specifying the table name.

Kings is a table name.

Group by clause is used to group the data on column house.

Several times in British history, kings or queens have deposed one another, so that their reigns overlapped. Find all such pairs, listing the pairs in both orders; i.e., list both (A,B) and (B,A). However, be careful not to list pairs A and B where the only overlap is that A's reign ended in the same year that B's began, or vice-versa.

Query:

      SELECT k1.name, k2.name FROM Kings k1, Kings k2

      WHERE k1.name <> k2.name

      AND k1.beginReign < k2.beginReign

      AND k2.beginReign < k1.beginReign;

Explanation:

SELECT is used to query the database and get back the specified fields.

name is a column of Kings table.

FROM is used to query the database and get back the preferred information by specifying the table name.

Kings is a table name. Two aliases named k1 and k2 are created.

WHERE is used to specify a condition based on which the data is to be retrieved. The conditions are as follows:

k1.name <> k2.name

k1.beginReign < k2.beginReign

k2.beginReign < k1.beginReign;

AND clause between the conditions indicate that both the conditions must be true.

AND clause between the conditions indicate that both the conditions must be true.

SELECT name, nickname FROM KingsWHERE beginReign <=1000 AND endReign >=1000;SELECT is used to query the database and get back the specified fields.name and nickname are columns of Kings table.FROM is used to query the database and get back the preferred information by specifying the table name.Kings is a table name.WHERE is used to specify a condition based on which the data is to be retrieved. The conditions are as follows:beginReign <=1000endReign >=1000

Hence, AND clause between the conditions indicate that both the conditions must be true.

Learn more about clause:

https://brainly.com/question/22633365

An easy way to validate configuration is to use an Oracle version of the TCP/IP ping utility, called

Answers

Answer:

TNSPING

Explanation:

tnsping is a utility, this helps us to determine the service on an Oracle Net network can be reached successfully.

If you want to connect between a client and server, we can use the tnsping utility, in this case, we're going to receive an estimated time around the trip in milliseconds it takes to reach the Oracle service, if it fails, we're going to receive an error message.

Supplementary Content (SC) is usually an important part of a webpage (but is not required for a page to receive a High or even Highest rating)

(A) True
(B) False

Answers

Answer:

The answer "False".

Explanation:

The related information on a web page, which does not enable you to understand the main topic but it includes related extra information, that leads to enhancing the client experience, is referred to as Supplementary Content. It is usually an important part of a web page but not necessary to obtain high or even average ratings for a blog, that's why the given statement is false.

Given a Fahrenheit value temperatureFahrenheit, write a statement that assigns temperatureCelsius with the equivalent Celsius value. While the equation is C

Answers

Answer:

# include<iostream>

#include<conio.h>

using namespace std;

main()

{

float f, c;

cout<<"enter temperature in Fahrenheit ="

cin<<f;

c=(f-32)/1.8;

cout<<"/n Temperature in Celsius ="<<c;

getch();

}

Explanation:

The conversion formula from Fahrenheit to Celsius is given as:

C= (F-32) x 5/9

we take an input in Fahrenheit and put in above formula and covert it in Celsius.

To Temperature conversionfrom Fahrenheit to Celsius, the formula is 'temperatureCelsius = (temperatureFahrenheit - 32) * 5/9'. This can be implemented as a statement in a program to assign a variable as needed, and the specifics of use will depend on the requirements of the program and language used.

To convert Fahrenheit to Celsius, we use the formula:

temperatureCelsius = (temperatureFahrenheit - 32) * 5/9

In programming, you can implement it as a statement that assigns the Celsius equivalent to a variable:

Example in Java:

int temperatureFahrenheit = 77;

double temperatureCelsius = (temperatureFahrenheit - 32) * 5.0/9.0;

System.out.println(temperatureCelsius);

This will directly convert the Fahrenheit temperature to Celsius. The specifics of how you would use this statement depend on the requirements of your program and the programming language you're using.

Learn more about Temperature conversion on:

https://brainly.com/question/23419049

#SPJ6

Please use C programming to write a code segment as an answer. Instead of using an while-loop like the following code, please implement a code segment by using a do-while loop. What is the output of the code?
#include
void main()
{
int i = 0;
while (i < 5);
{
printf("%d ", ++i);
}
}

Answers

Answer:

The program using do-while loop defined as follows:

Program:

#include <stdio.h> //include header file

int main() //defining main method

{

int i = 0; //defining integer variable i and assign value.

//defining do-while loop

do  

{

printf("%d", ++i); //print value

}while (i<5); //check condition  

return 0;

}

Output:

12345  

Explanation:

Output of given program:

In the given program, it will not print any value because in while loop semi colon is used which is not valid.

Program Explanation:

In the above C language program header file is included, which provides features to use basic function then the main method is defined inside this method an integer variable "i" declare, that holds a value which is "0".  In this method, the do-while loop is defined. In the do section, we print value and in the while block checks the condition which is i is less than 5.

Answer:

#include <stdio.h>

void main()

{

int i = 0;

do{

printf("%d ", ++i);

}

while (i < 5);

i=i+1;

}

}

Explanation

The #include needs to include something and that's the standard input and output which is coded has stdio.h

In the do while loop what it does is print the value of I while I is less than 5 and you increment I value so as to prevent infinite looping

The key to providing controlled variability in algorithms is to employ one or more placeholders, called Select one a. methods b. numbers c. parameters d. polynomials e. functions

Answers

Answer:

c. parameters

Explanation:

Parameters are simply placeholders (sometimes called dummy variables) used mainly by methods to perform their given tasks so as to provide controlled variability in  the program(or algorithm). Sometimes they are called arguments. But then it is much more specific to simply use parameters rather than arguments because arguments are the variable values that the parameters are serving as placeholders for.

Parameters identify and describe values that are passed into a function or subroutine.

Parameters are also used for simulation and testing purposes where the input s to the program are or can be varied.

PS: Methods are just functions performed by a class in a program.

A _____________ is a method of controlled entry into a facility and provides access to secure areas such as a research lab or data center

Answers

Answer:

The correct answer to the following question will be "Mantrap".

Explanation:

A Mantrap, an airlock, or an authentication vestibule is a data security network management mechanism composed of a confined space of two sets of interlinking doors, so the first collection of doors should be locked until the second period decides to open.It is a network management machine designed and limited to a finite space that would be segregated by two gates from adjoining rooms, usually an extraction point and an entrance door that could not be activated at almost the same period.

Therefore, Mantrap is the right answer.

Write a program named CountVowelsModularized that passes a string to a method that returns the number of vowels in the string.

Note: For testing purposes, Y will not be counted as a vowel.

Answers

Answer:

import java.util.Scanner;

public class CountVowelsModularized {

   public static void main(String[] args) {

       Scanner in = new Scanner (System.in);

//Prompt user to enter a string, receive it and assign to a variable        

System.out.println("Enter a string Value");

       String word =in.nextLine();

//Calling the method numVowels and passing the string

       System.out.println("The Number of vowels are " +numVowels(word.toLowerCase()));

   }

}

The method definition and complete program is given in the explanation section

Explanation:

import java.util.Scanner;

public class CountVowelsModularized {

   public static void main(String[] args) {

       Scanner in = new Scanner (System.in);

       System.out.println("Enter a string Value");

       String word =in.nextLine();

       System.out.println("The Number of vowels are " +numVowels(word.toLowerCase()));

   }

   public static int numVowels(String string) {

       int counter = 0;

       for (int i = 0; i < string.length(); i++) {

           if (string.charAt(i) == 'a' || string.charAt(i) == 'e' || string.charAt(i) == 'i'

                   || string.charAt(i) == 'o' || string.charAt(i) == 'u') {

               counter++;

           }

       }

       return counter;

   }

}

Final answer:

The CountVowelsModularized program is a Java application that counts the number of vowels in a string via a dedicated method. The program treats 'a', 'e', 'i', 'o', and 'u' as vowels and does not count 'y'. The solution demonstrates a modular design in which functionality could be easily modified or expanded.

Explanation:

The question asks to write a program named CountVowelsModularized which includes a method that counts the number of vowels in a provided string. In this case, the vowels to be counted are a, e, i, o, and u. The letter y will not be considered a vowel for this particular task. Below is an example code written in Java that demonstrates how you could implement such a program:

public class CountVowelsModularized {

   public static void main(String[] args) {
       String inputString = "Example string";
       System.out.println("Number of vowels: " + countVowels(inputString));
   }

   public static int countVowels(String str) {
       int vowelCount = 0;
       for(int i = 0; i < str.length(); i++) {
           char c = str.charAt(i);
           if(c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' ||
              c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U') {
               vowelCount++;
           }
       }
       return vowelCount;
   }
}

This modularized approach provides a clear path to expand or modify the program, should the definitions of vowels change or additional functionality be required.

"Explain the functionality of the different layers found in the network protocol stack of an operating system such as Linux"

Answers

Answer:

There are 7 layers in linux.

Explanation:

As networking is difficult and complex.

Imagine if every application had to know how to communicate on every step that would be more than just complex. So, rather than reinvent something which will help it to communicate let’s just make something that will automatically controls the communication and for that protocols came in to live.

As for the linux operating system, it is not exceptional from other operating systems.

There are 7 layers on network protocol stack use to communicate with other network protocol stack.

1. Application layer

2. System call interface

3. Protocol agnostic interface

4. Network protocol

5. Device agnostic interface

6. Device drivers

7. Physical hardware

All the layers vary in their functionality.

One more important thing to remember is that the network protocol stack layers is not one way its 2 way communication. First, when a client request to a network and second, when the request is full filled.

The top most layer is a part of user space, the next five layers comes in the kernel space and the final layer is the physical layer.

Application layer:

When a client or user request to  a network the request initially comes to this layer.

On this layer we use tcp/ip protocol.

System call interface(SCI):

When application layer make a call to the kernel this layer handles that call. And take the request to the next layer.

Protocol agnostic interface:

This layer has two functions “talking” or “listening”. There is a thing called sockets which perform these functions and each socket has an id which is used specifically for an application.

Network protocol:

This layer is used for how the data is sent or received.

Device agnostic interface:

It is used to connect data from/to kernel user space and the network device drivers which allows the data to prepare itself for transmission over the medium from the network device.

Physical hardware :

This layer is responsible for the data packets transmission and received from the network medium being used whether cable or wireless.

Write a while loop that prints

A. All squares less than n. For example, if n is 100, print 0 1 4 9 16 25 36 49 64 81.

B. All positive numbers that are divisible by 10 and less than n. For example, if n is 100, print 10 20 30 40 50 60 70 80 90

C. All powers of two less than n. For example, if n is 100, print 1 2 4 8 16 32 64.

Answers

Answer:

# include <iostream>

#inlcude<conio.h>

using namespace std;

main()

{

int n,x;

cout<<"Enter Value of n"

cin>>n;

x=0;

while (x<n)

{

cout<< "Square of Value "<<x^2;

if (x%10==0)

{

cout <<x;

}

cout<<"2^"<<x<<"="<< 2^x;

x++;

}

getch();

}

The git _____ command will display the last commit and what were the changes you made.

Answers

Answer:

Log

Explanation:

The git log command enables you to display a list of all of the commits on your current branch

Technological uncertainty:

a. is a result of uncertainty about customer demand.
b. occurs because an alternative technology could be introduced by competitors.
c. only occurs in emerging markets.
d. can be avoided by early entrants with superior technology.

Answers

Answer:

The correct answer is: "b. occurs because an alternative technology could be introduced by competitors".

Explanation:

It is very difficult to assess how technological uncertainty has been developed and maintained throughout the years, although it is possible to state that it may occurs when other alternative technologies are developed and launched, besides other factors. Technology companies and agencies are interested in developing their products as best as possible, therefore, competition increases with marketability and produces uncertainty among all developers, software and hardware engineers, and other Information Technology (IT) workers who are responsible for creating new technological tools which may solve the problem of uncertainty among them all and improve society.

(ps: mark as brainliest, please?!)

A(n) ________ is information that is passed to a function, and a(n) ________ is information that is received by a function.

a. function call,
b. function header parameter,
c. argument argument,
d. parameter prototype,
e. header
f. None of these

Answers

Answer:

i looked it up and the answer i got would be D

Explanation: hope this helps!

-Which of the following is true about Web services?
A - Web services are open standard XML, SOAP, HTTPetc. based Web applications.
B - Web services interact with other web applications for the purpose of exchanging data.
C - Web Services can convert your existing applications into Web-applications.
D - All of the above

Answers

Answer:

The answer is "Option D".

Explanation:

Web service is also known as an online open software product, which uses a common XML messaging service system. It is used service like HTTP, SOAP, etc, that encrypts messages from all web services.

It uses the internet, that enables you the interface or application for the user interaction or exchanging data. It will turn the software into web apps.

What is the importance of constraints in a physical model? What role do different constraints play in maintaining referential integrity and data integrity?

Answers

Answer with Explanation:

Constraints are a very important feature in a relational model. Constraints are useful because they allow a designer to specify the semantics of data in the database. They are the rules that force Database Management Systems (DBMSs) to check that data satisfies the semantics.

Data integrity is the overall completeness, accuracy and consistency of data. This can be indicated by the absence of alteration between two instances or between two updates of a data record, meaning data is intact and unchanged

Referential integrity (RI) is a method for ensuring the “correctness” of data within a Database Management System. It embodies the integrity and usability of a relationship by establishing rules that govern that relationship.

Proper database RI ensures data integrity for both planned application programs and for queries in ad hoc SQL statements and BI tools.

By defining referential constraints, you can set up the database to control the semantic accuracy of the data it contains. To define a referential constraint, you must create a primary key in the parent table and a foreign key in the dependent table.

You must also define what actions are allowed when data is added or modified. This is accomplished with a set of rules applied to each relationship. The combination of the primary and foreign key columns and the rules that dictate the data that can be housed in those key columns can be defined to ensure correct and useful relational databases.

So, it is a good physical database design practice to implement referential integrity using database constraints.  

Other Questions
Help me Find the arc length of a circle in terms of pi If a fee of $2,850 earned from a client was debited to Accounts Receivable for $2,580 and credited to Fees Earned for $2,850, which of the following would be true?a) The credit total of the trial balance would be higher by $270.b) b. The debit total of the trial balance would be higher by $270.c) The wrong account is creditedb) the trial balance total would be equal What is the correct negation of "There is someone in Spain who speaks at least 10 languages"?1) "Everyone in Spain speaks at least 10 languages."2) "Everyone outside of Spain speaks at least 10 languages."3) "There is someone in Spain who speaks at most 9 languages."4) "Everyone in Spain speaks at most 9 languages."5) "Everyone outside of Spain speaks at most 9 languages."6) "There is someone outside of Spain who speaks at most 9 languages."7) "There is someone outside of Spain who speaks at least 10 languages." What does Alcott mean by the phrase I put my bashfulness in my pocket?A)She decided to talk to a fellow traveler.B)She decided to keep her opinions to herself.C)She knew a lady must keep her wits about her.D)She wasn't fooled by the offer of conversation. Suppose that exposure to a chemical mutagen results in a change in the sequence that alters the 5' end of intron 1 (I). What might occur?a. loss of the gene productb. loss of Ec. premature stop to the mRNAd. inclusion of I1 in the mRNAe. exclusion of E2 the Rodriguez family need to drive 250 miles to visit their cousins. if they have already driven 113.8 miles how much farther do they need to drive? The rate of the reaction in terms of the "disappearance of reactant" includes the change in the concentration of the reactant, the time interval, and the coefficient of the reactant.Consider the following reaction:2A+3B3C+2DThe concentrations of reactant A at three different time intervals are given. Use the following data to determine the average rate of reaction in terms of the disappearance of reactant A between time = 0 s and time = 20 s .Time (s )02040[A](M)0.04000.02400.0180Express your answer in molar concentration per second to three significant figures.Part BThe rate of the reaction in terms of the "appearance of product" includes the change in the concentration of the product, the time interval, and the coefficient of the product.Consider the following reaction:2A+3B3C+2DThe concentrations of product C at three different time intervals are given. Use the following data to determine the rate of reaction in terms of the appearance of product C between time = 0 s and time = 20 s .Time (s )02040[C](M)0.0000.02400.0480Express your answer in molar concentration per second to three significant figures. What are accepted without proofs in a logical system Between which zones and a DMZ should firewalls be placed? Choose two answers.RemoteSegregatedInternalExternal "The United States in Congress assembled shall never engage in a war, nor grant letters of marque or reprisal in time of peace, nor enter into any treaties or alliances, ... unless nine States assent to the same."Articles of Confederation. One side of a shipping container measures 8 feet. The container is a cube. What is the container's volume in cubic feet? (A)cubic feet (B)cubic feet(C)64 cubic feet(D)512 cubic feet According to Family Systems Theory, understanding the authority structure of a family is important. For example, family systems practitioners want to know who makes the decisions and who enforces the rules in a family. These family processes are known as _____ in this theory. A bus traveled 336 traveled 336 miles in 7 hours. If the continues at the same number of miles per hour, how many miles will the bus travel in 15 hours? Explain In many animal cells, the uptake of glucose into the cell occurs by a cotransport mechanism, in which glucose is cotransported with Na^+ ions. Complete the diagram below using the following steps. Drag the pink labels to the pink targets, indicating the relative concentration at glucose inside and outside the cell. Drag the correct white target to the white target, indicating the direction that Na^+ ions and glucose move through the cotransporter Drag the blue labels to complete the sentences on the right, indicating how Na^+ ions and glucose move through the cotransporter relative to their electrochemical and concentration gradients. Which of these statements about family relationships is true on Colonel Lloyds plantation?Friendships with brothers and sisters are the only cheerful part of life on this harsh plantation.Children are separated from parental figures, and sibling relationships are not encouraged.When young children seek the comforts of home, they often travel with their siblings.Enslaved children visit their parents and grandparents on neighboring plantations when they travel. What was the difference between the estimated versus actual forced vital capacity? When might it be useful to use the estimated numbers instead of measurements? Which Windows Server 2016 feature allows a user to utilize a software environment in which an application can run but is isolated from much of the rest of the operating system and other applications? _____ are often used as context variables to ensure that samples in different cultures actually harbor the cultural characteristics thought to differentiate them. what is the answer to -2 1/2+4 Beck was the general manager of Chilkoot Lumber Co. Haines sold fuel to the company. To persuade Haines to sell on credit, Beck signed a paper by which he promised to pay any debt the lumber company owed Haines. He signed this paper with his name followed by "general manager." Haines later sued Beck on this promise, and Beck raised the defense that the addition of "general manager" showed that Beck, who was signing on behalf of Chilkoot, was not personally liable and did not intend to be bound by the paper. Was Beck liable on the paper? Steam Workshop Downloader