Answer:
using namespace std;
int main() {
int number;
while (1) {
cout << "Enter a number: ";
cin >> number;
cout << number << " is " << ((number % 2) ? "odd" : "even") << endl;
};
return 0;
}
Explanation:
This is a c++ version. Let me know if you need other languages.
The (number % 2) is the essence of the program. It returns 0 for even numbers, and 1 for odd numbers (the remainder after division by 2).
True or false?
FCC Guidelines restrict the amount of RF radiation that can be "leaked" by non-industrial equipment?
Answer:
True
Explanation:
The Federal communications commission (FCC), is responsible for evaluating the effect of radio frequency and electromagnetic radiations and emissions on the consumers of products which make use of these frequencies and radiation energy. Devices such as cell phones are not allowed to emit radiation higher than a certain safe standard or frequency, set by the Federal communications commission.
The Federal communications commission also provides bulletins and publications that present safety information and guidelines for industries and consumers involved with radio frequency and electromagnetic radiation.
write a pseudocode thats accept and then find out whether the number is divisible by 5
Answer:
input number
calculate modulus of the number and 5
compare outcome to 0
if 0 then output "divisible by 5"
else output "not divisible by 5"
Explanation:
The modulo operator is key here. It returns the remainder after integer division. So 8 mod 5 for example is 3, since 5x1+3 = 8. Only if the outcome is 0, you know the number you divided is a multiple of 5.
Answer the following
1. Explain the difference between likelihood and probability.
2. Give an example of a set of clusters in which merging based on the closeness of clusters leads to a more natural set of clusters than merging based on the strength of connection (interconnectedness) of clusters.
Answer:
zero, foresight
Explanation:
figure it out
1.16 LAB: Input: Welcome message Write a program that takes a first name as the input, and outputs a welcome message to that name. Ex: If the input is Pat, the output is:
Full Question
Write a program that takes a first name as the input, and outputs a welcome message to that name. Ex: If the input is Pat, the output is: Hello Pat, and welcome to CS Online!
Answer:
Python
nname = input("What is your name: ")
print("Hello "+nname+" , and welcome to CS Online!")
Explanation:
The programming ls not stated; However, I'll answer using Python
Python (See bold texts for line by line explanation)
This line prompts the user for input
nname = input("What is your name: ")
This line prints the welcome message
print("Hello "+nname+" , and welcome to CS Online!")
________ is the branch of computer science that deals with the attempt to create computers that think like humans.
Answer:
Artificial Intelligence (AI)
Explanation:
Artificial intelligence is a way of making computers to think critically, or act like humans. It involves the application of computer science and technology to produce critical problem solving device as humans.
It is a welcomed development and well accepted innovation to complement humans in proffering solutions to logical and critical problems. It has various applications in influencing the result or solution to mentally demanding tasks that require high intelligence.
Which of these is an example of output?
typing on a keyboard
a smartphone ringing
using a mouse
a fingerprint sensor
Answer:
a smartphone ringing
Explanation:
An output device is a computer hardware that converts data or signals into readable form like text, graphic, audio, video, tactile. Example of output devices are monitor, speaker, printer, projector. A smartphone ringing is a computer hardware because it converts the information into readable form in the form of sound.
Input devices is a computer hardware that sends information to the computer for interaction and control. Examples are mouse, keyboard, fingerprint sensor, scanner e.t.c.
Dani wants to create a web page to document her travel adventures. Which coding language should she use? HTML Java Python Text
Answer:
I would recommend Python Programming languageExplanation:
The major reason i recommend python is that It has a ton of resources, and community support, such that it is practically impossible to get stuck while carrying out a project
Python is easy,and lets you build more functions with fewer lines of code.
More so, provides a stepping stone to learning other code and it is a very flexible language
The first version of the SMTP protocol was defined in RFC 821. The current standard for SMTP is defined in RFC 5321 considering only RFC 821 what are the main commands of the SMTP protocol?
Answer:
The following are the explanation for each command, with the SMTP protocol considering only RFC 821.
Explanation:
The key commands of the SMTP protocols which take the RFC 821 into account are as follows:
HELLO -
A client receives that order to describe himself
HELP-
It asks by the receivers to submit the command information as argument
QUIT -
It is used to terminate the message.
-FROM MAIL
The clients use it to acknowledge the message's sender.
NOOP -
The client does not use any procedure to verify the receiver status as required by the receiver's reply form.
RCPT-
The user needs it to determine the intended beneficiary.
SAML-
It sends or ends the specific mail which is sent to the mailbox or the SAML
RESET-
The existing email transaction is aborted.
SEND- The mail to be sent by the recipient's terminal, not its mailbox, is specified.
TURN-
It allows the sender to change position and recipients.
VRFY-
Verification checks the recipient's address.
Write an Enlistee class that keeps data attributes for the following pieces of information: • Enlistee name • Enlistee number Next, write a class named Private that is a subclass of the Enlistee class. The Private class should keep data attributes for the following information: • Platoon number (an integer, such as 1, 2, or 3) • Years of service (also an integer)
Answer:
function Enlistee( name, number ){
constructor( ){
super( ) ;
this.name= name;
this.number= number;
this.Private= ( platoonNumber, yearOfService ) =>{
this.platoonNumber = platoonNumber;
this.yearOfService = yearOfService;
}
}
}
Explanation:
In Javascript, OOP ( object-oriented programming) just like in other object oriented programming languages, is used to create instance of a class object, which is a blueprint for a data structure.
Above is a class object called Enlistee and subclass "Private" with holds data of comrades enlisting in the military.
Assign numMatches with the number of elements in userValues that equal matchValue. userValues has NUM_VALS elements. Ex: If userValues is {2, 1, 2, 2} and matchValue is 2 , then numMatches should be 3.
Your code will be tested with the following values:
userValues: {2, 1, 2, 2}, matchValue: 2 (as in the example program above)
userValues: {0, 0, 0, 0}, matchValue: 0
userValues: {20, 50, 70, 100}, matchValue: 10
#include
using namespace std;
int main() {
const int NUM_VALS = 4;
int userValues[NUM_VALS];
int i;
int matchValue;
int numMatches = -99; // Assign numMatches with 0 before your for loop
cin >> matchValue;
for (i = 0; i < NUM_VALS; ++i) {
cin >> userValues[i];
}
/* Your solution goes here */
cout << "matchValue: " << matchValue << ", numMatches: " << numMatches << endl;
return 0;
}
Answer:
add new for each loop:
for (int i : userValues)
if(i == matchValue) numMatches++;
this goes through every userValue and check if it matches match Value.
if it does, then increment numMatches.
The purpose of an interface is to:___________
a) provide similar objects with the same functionality, even though each will implement the functionality differently
b) provide different types of objects with the comparable functionality, even though each will implement the functionality differently
c) provide default implementations of methods and properties
d) None of the above.
Answer:
Purpose of the interface
Provides communication − One of the uses of the interface is to provide communication. Through interface you can specify how you want the methods and fields of a particular type.Jul
explain 10 challenges in the use of ICT
There are multiple challenges to the ICT education system, here are a few:
ICT is susceptible to various cyber-threats ICT limits the imagination and observance powerIt also arises various health-related problemsNonverbal communication. Student laziness Less security. Social isolation.The Implementation of ICT is much costly.Increases Unemployment and lack of job security Increases Dominant culture within the workplaceBefore creating a brief to design a product, what is needed
Answer:
A good design brief often begins with some information about the client and what their brand stands for. Including this helps to connect an individual project with the bigger picture. Aim to capture key points about what the company does, how big they are, and what their key products or services are.
Explanation:
A good design brief often begins with some information about the client and what their brand stands for. Including this helps to connect an individual project with the bigger picture. Aim to capture key points about what the company does, how big they are, and what their key products or services are.
When first defining the cloud, NIST gave three service models, which can be viewed as nested service alternatives: software as a service, platform as a service, and _________ as a service.
Answer:
Infrastructure.
Explanation:
In Computer science, Cloud computing can be defined as a type of computing that requires shared computing resources such as cloud storage (data storage), servers, computer power, and software over the internet rather than local servers and hard drives. It offers individuals and businesses a fast, effective and efficient way of providing services.
Simply stated, Cloud computing are services or programs located on the Internet, they are usually remote resources making use of cloud storage.
When first defining the cloud, National Institute of Standards and Technology (NIST) gave three (3) service models, which can be viewed as nested service alternatives;
1. Software as a Service (SaaS).
2. Platform as a Service (PaaS)
3. Infrastructure as a Service (IaaS).
According to NIST, the five (5) characteristics of a cloud computing service are;
1. On-demand self-service .
2. Broad network access .
3. Resource pooling .
4. Rapid elasticity .
5. Measured service.
Additionally, the cloud service can either be deployed as private, public, hybrid or community service.
What does the following code output? System.out.println((5+20 + 5)
* (10 / 10))
Explanation:
the output of your code is 30
It is possible to force the Hardware Simulator to load a built-in version of chip Xxx. This can be done by:
Answer:
The answer is "It Specifies the built-in chip in the module header".
Explanation:
The hardware simulator is also an instrument about which the device physical models could be constructed, in the mainframe, which includes a console, a power supply, or multiple sockets for plugging regular modules.
It plays a specific role in the computing system, and it is also essential for each standard module. In the hardware controller, it can be used to launch an integrated Xxx processor version, which can be achieved by listing the built-in chip throughout the module header.token is 64 bytes long (the 10-Mbps Ethernet minimum packet size), what is the average wait to receive the token on an idle network with 40 stations? (The average number of stations the token must pass through is 40/2 = 20.
Given that,
Token is 64 bytes long
The average number of stations that the token must pass = 20
We need to calculate the transmission delay for token
Using formula of transmission delay
[tex]Transmission\ delay=\dfrac{token\ size}{minimum\ size}[/tex]
Put the value into the formula
[tex]Transmission\ delay=\dfrac{64\ bytes}{10\ Mbps}[/tex]
[tex]Transmission\ delay=\dfrac{64\times8}{10\times10^6}[/tex]
[tex]Transmission\ delay=0.0000512\ sec[/tex]
[tex]Transmission\ delay=5.12\times10^{-5}\ sec[/tex]
We need to calculate the average wait to receive token on an idle network with 40 stations
Using formula of average wait
[tex]\text{average wait to receive token}=\text{average number of stations that the token must pass}\times transmission\ delay[/tex]
Put the value into the formula
[tex]\text{average wait to receive token}=20\times5.12\times10^{-5}[/tex]
[tex]\text{average wait to receive token}= 0.001024\ sec[/tex]
[tex]\text{average wait to receive token}= 1.024\ ms[/tex]
Hence, The average wait to receive token on an idle network with 40 stations is 1.024 ms.
Recent advances in information technologies (IT) have powered the merger of online and offline retail channels into one single platform.
a. True
b. False
Answer:
True
Explanation:
With the recent advancement in IT we have witnessed offline retail businesses begin to get online presence. The advancement of the e-commerce sector and the convenience that it brings to customers through providing the ability to make orders online and get goods delivered to their doorsteps in a short time, has brought about escalating growth in the online and in extension offline retail businesses.
Big retail chains such as Walmart are taking advantage of this to increase their sales. Also, online retail presence helps put offline businesses out there in terms of advertising and marketing.
A wedding photographer taking photos of the happy couple at a variety of locations prior to their wedding would be classified as a reactive system on the service system design matrix.A. TrueB. False
Answer:
True
Explanation:
Touch screens are becoming extremely popular input devices for phones and tablets. Assess the value of touch screen devices related to human-computer interaction systems. Identify at least two advantages and two disadvantages of having touch screen devices in the workplace. Support your response by citing a quality resource.
Answer:
Two advantages of touch screen inputs are; free of hardware input problems and the adaptivity of mobile applications.
Two disadvantages of touch screen inputs are; screen usage and software error.
Explanation:
Touch screen input is a slick application of finger-on-screen interaction with gadgets, that promotes mobility. It cancels the need for hardware input devices, reducing system size and weight.
But with its slickness comes extra memory usage and screen space consumption.
Please help me please and thank you!
Answer:
1. a digital designer involves movement like animations, movies, etc. A graphic designer is static for an example logos pictures etc.
2. a ux is the interaction between humans and products
3. a ui is the design of software and machines, for an example computers, electronic devices, etc.
4. textures, color, value, and space
5. the basics are contrast, balance, emphasis, white space, hierarchy, movement, proportion, repetition, pattern, variety, unity, and rhythm
6. the basic fundamentals are images, color theory, lay-out, shapes, and typograph
I hope this helped you and have a great rest of your day
In recent years, there has been an effort by companies to make computer chips:
O smaller.
O larger.
O bendable.
O harder
Answer:
A
Explanation:
Answer:
A) smaller
Explanation:
A ________ keeps your computer safe by determining who is trying to access it. gateway hub firewall switch
Answer:
firewall
Explanation:
a fire wall keeps unwanted hackers and viruses out of a computers system
Password Verifier Imagine you are developing a software package that requires users to enter their own passwords. Your software requires that users’ passwords meet the following criteria: The password should be at least six characters long. The password should contain at least one uppercase and at least one lowercase letter. The password should have at least one digit. Write a program that asks for a password then verifies that it meets the stated criteria. If it doesn’t, the program should display a message telling the user why.
Answer:
Here is the C++ program:
#include <iostream> //to use input output functions
using namespace std; //to identify objects like cin cout
bool verifyLength(string password); // to verify length of password
bool verifyUpper(string password); //to verify if password contains uppercase letters
bool verifyLower(string password); //to verify if password has lowercase letters
bool verifyDigit(string password); // to verify if password contains digits
int main() { //start of main() function
string password = " "; //to hold password string input by user
while(true) { //loop that verifies the password. The loop keeps prompting user to enter a valid password telling what criteria is to be met to verify password.
cout << "\nPlease enter your password: "; // prompts user to enter a password
getline(cin, password); //reads and gets password from user
if (verifyLength(password) == false) // calls verifyLength to check length criteria for password. Checks if length of password is less than 6
{ cout << "The password should be at least six characters long.\n";}
else if (verifyUpper(password) == false) { // calls verifyUpper to check criteria for password letters to be in uppercase. Checks if password does not have an uppercase letter
cout << "The password should contain at least one uppercase letter.\n"; }
else if (verifyLower(password) == false) { // calls verifyLower to check criteria for password letters to be in lowercase. Checks if password does not contain a lowercase letter
cout << "The password should contain at least one lowercase letter.\n"; }
else if (verifyDigit(password) == false) { // calls verifyDigit to check digit criteria for password. Checks if password does not contain a digit
cout << "The password should have at least one digit.\n"; }
else { //if password meets the criteria
cout << "Password verified!\n";
break; } } } //breaks the loop
Explanation:
Here are the method that are called to verify the stated criteria:
bool verifyLength(string password) { // this method takes input password as parameter to verify the length criteria and returns true of false accordingly
bool length = false; // the bool type variable length is initially set to false
if(password.length() >= 6) //if the length of the password that is obtained by using length() function is greater than or equals to 6 then it means it meets valid password length criteria
length = true; //set length to true when above if statement is true
else //if length of password is less than 6
length = false; //set length to false if length of password is less than 6
return length; } //return the state of length
bool verifyUpper(string password) { // this method takes input password as parameter to verify the uppercase criteria and returns true of false accordingly
bool upper = false; // the bool type variable upper is initially set to false
for (int i = 0; i < password.length(); i++) { //the loop iterates through the letter of password string until the length of the string is reached
if (isupper(password[i])) { //it checks if any letter of the password is in uppercase using the isupper() method
upper = true; } } //set upper to true when above if condition is true
return upper; } //returns the state of upper
bool verifyLower(string password) { // this method takes input password as parameter to verify the lowercase criteria and returns true of false accordingly
bool lower = false; // the bool type variable lower is initially set to false
for (int i = 0; i < password.length(); i++) { //the loop iterates through the letter of password string until the length of the string is reached
if (islower(password[i])) { //it checks if any letter of the password is in lowercase using the islower() method
lower = true; } } //set lower to true when above if condition is true
return lower; } //returns the state of lower accordingly
bool verifyDigit(string password) { // this method takes input password as parameter to verify the digit criteria and returns true of false accordingly
bool digit = false; // the bool type variable digit is initially set to false
for (int i = 0; i < password.length(); i++) { //the loop iterates through each letter of password string until the length of the string is reached
if (isdigit(password[i])) { //it checks if any letter of the password is a digit using the isdigit() method
digit = true; } } //set digit to true when above if condition is true
return digit; } //returns the state of digit accordingly
The output of program is attached.
4. What are the basic scientific principles the engineers who designed the digital scales
would have needed to understand to design this tool? Choose all that apply.
A. electric currents
B. physical properties of metals
C. influence of gravitational force on objects
D. physical and chemical properties of materials used in building circuits
Answer:
A, C and D
Explanation:
A digital scale is a measuring device used to measure the weight of an object. Unlike the mechanical version, the digital scale displays the numeric value of an object weight on a screen, that is, it does not use any mechanical part like a pointer.
To design this scale, the engineers heard to understand the principles of electric current which powers the device, the influence of gravitational force on objects for which a sensor is used to collect the weight of objects and convert it to digits, and the physical and chemical properties of materials used in building the digital scale circuits.
In today’s fast-paced, often "agile" software development, how can the secure design be implemented?
Answer:
Answered below
Explanation:
The agile approach to software development involves development through the collaborative efforts of integrated and organised teams and users. Nowadays, people follow this approach because it allows for faster deployment, continuous updates as well as flexibility in development.
In the face of this rapid development and deployment, security design can be a challenge to keep up with.
Some steps to implement security in an agile environment include;
- Approaching security implementation in the same agile way as software development.
- Making software developers responsible for secure development and implementation.
- Utilising continuous integration of security practices by integrating security solutions with the development tools.
In most cases, it is possible to prevent an exception from terminating a program by using the try and except statements. Select one: True False
Answer:
True
Explanation:
Try and except statements (pseudo code) or try and catch (java, c++, etc)
is for error handing. The try and except "handles errors" If encountered an error, the try and except will try to "handle" the error and let the program continue running.
Show the array that results from the following sequence of key insertions using a hashing system under the given conditions: 5, 205, 406, 5205, 8205, 307 (you can simply list the non-null array slots and their contents)
a. array size is 100, linear probing used.
b. array size is 100, quadratic probing used.
Answer:
a) Linear probing is one of the hashing technique in which we insert values into the hash table indexes based on hash value.
Hash value of key can be calculated as :
H(key) = key % size ;
Here H(key) is the index where the value of key is stored in hash table.
----------
Given,
Keys to be inserted are : 5 , 205, 406,5205, 8205 ,307
and size of the array : 100.
First key to be inserted is : 5
So, H(5) = 5%100 = 5,
So, key 5 is inserted at 5th index of hash table.
-----
Next key to inserted is : 205
So, H(205) = 205%100 = 5 (here collision happens)
Recompute hash value as follows:
H(key) =(key+i) % size here i= 1,2,3...
So, H(205) =( 205+1)%100 = 206%100 = 6
So, key 205 is inserted in the 6th index of the hash table.
----------
Next Key to be inserted : 406
H(406) = 406%100 = 6(collision occurs)
H(406) =(406+1) %100 = 407%100 = 7
So, the value 406 is inserted in 7the index of the hash table.
-----------------
Next key : 5205
H(5205) = 5205%100 = 5(collision)
So, H(5205) = (5205+1)%100 = 6( again collision)
So, H(5205) = 5205+2)%100 = 7(again collision)
So, H(5205) = (5205+3)%100 = 8 ( no collision)
So, value 5205 is inserted at 8th index of the hash table.
-------------
Similarly 8205 is inserted at 9th index of the hash table because , we have collisions from 5th to 8th indexes.
-------------
Next key value is : 307
H(307) = 307%100 = 7(collision)
So, (307+3)%100 = 310%100 = 10(no collision)
So, 307 is inserted at 10th index of the hash table.
So, hash table will look like this:
Key index
5 5
205 6
406 7
5205 8
8205 9
307 10
b) Quadratic probing:
Quadratic probing is also similar to linear probing but the difference is in collision resolution. In linear probing in case of collision we use : H(key) = (key+i)%size but here we use H(key) =( key+i^2)%size.
Applying Quadratic probing on above keys:.
First key to be inserted : 5.
5 will go to index 5 of the hash table.
-------
Next key = 205 .
H(205) = 205%100 = 5(collision)
So. H(key)= (205+1^2)%100 = 6(no collision)
So, 205 is inserted into 6th index of the hash table.
--------
Next key to be inserted 406:
So, 406 %100 = 6 (collision)
(406+1^2)%100 = 7(no collision)
So, 406 is moved to 7th index of the hash table.
----------
Next key is : 5205
So, 5205%100 = 5 (collision)
So, (5205+1^2)%100 = 6 ( again collision)
So, (5205+2^2)%100 = 9 ( no collision)
So, 5205 inserted into 9th index of hash table.
-----------
Next key is 8205:
Here collision happens at 5the , 6the , 9th indexes,
So H(8205) = (8205+4^2)%100 = 8221%100 = 21
So, value 8205 is inserted in 21st index of hash table.
--------
Next value is 307.
Here there is collision at 7the index.
So, H(307) = (307+1^2)%100 = 308%100= 8.
So, 307 is inserted at 8the index of the hash table.
Key Index
5 5
205 6
406 7
5205 9
8205 21
307 8
For this lab, you will do some work on a GUI program. Most of the work is related to actions, buttons, menus, and toolbars.
When you turn in your work for this lab, you should also turn in an executable jar file of your program, in addition to all the files from your Eclipse project. See the last section on this page for information about how to create executable jar files.
To begin the lab, create a new project in Eclipse and copy-and-paste both directories – guidemo and resources -- from the code directory in this linke :
The guidemo directory is a package that contains the Java code of the program. The resources directory has several sub-directories that contain image and sound resources used by the program. You will be working only on the code in the guidemo package.
The code directory also contains an executable jar file of the completed program, GuiDemoComplete.jar. You can run this jar file to see how the program should look when it's done. In the incomplete source code that you will be working on, the main class is in GuiDemo.java, and you can execute that file to see what the program does so far.
=========================
Make a Menu
The program has a toolbar at the bottom of the window. The buttons in this toolbar have icons. If you click one of the icons, you can then use the mouse to "stamp" copies of the icon onto the picture. (Note that a short sound is played when you stamp.) If you click the button "DEL", you can use the mouse to erase icon images from the picture.
The toolbar is made by adding Actions to a JToolBar object. This is done in the class IconSupport, which contains a list of actions and a createToolbar method to create a toolbar from the actions.
Write a method createMenu() in the IconSupport class to create and return a menu with the same functionality as the toolbar. That is, all the Actions from the actions arraylist should be added to the menu, just as they were added to the toolbar. (Remember that a menu is represented by an object of type JMenu, which can be created, for example, with: JMenu stamper = new JMenu("Stamper");)
Once you have a method to create the menu, find the place in the constructor of the GuiDemo class where the menu bar is created. Use the method to create a menu, and add that menu to the menu bar. Test to make sure that it is working.
sorry
Explanation: don't understand
Overloaded methods must be differentiated by: Select one: a. method name b. data type of arguments c. method signature d. None of the above
Answer:
b. data type of arguments
Explanation:
One of the ways to overload a method is using different type of arguments. Let's say we have a method that finds and returns two integer values
public int sumValues(int num1, int num2){
return num1 + num2;
}
We can overload this method by passing double values as arguments
public double sumValues(double num1, double num2){
return num1 + num2;
}