#include <iostream>
using namespace std;
int main() {
string input;
string rand_type;
int number=rand()%100+1; //number between 1 and 100
if ( number % 2 == 0)
rand_type= "even";
else
rand_type="odd";
cout << "your guess: ";
cin >> input;
if ( input== rand_type)
cout << "correct.\n";
else
cout << "incorrect.\n";
return 0;
}
Cryptography is the practice of encryption. Information Security uses cryptography techniques to encrypt and decrypt data. A simple encryption method might take plaintext and mix up the letters using some predetermined pattern and then use that pattern to decrypt the data for reading.
Ciphers are the algorithms used to put the data into its secret pattern and then systematically decrypt it for reading. This script is going to use a famous simple cipher called the Caesar Cipher. It is a substitution cipher where each letter in the text is 'shifted' in a certain number of places. It uses the alphabet as the primary pattern and then based on the shift number, it would shift all the letters and replace the alphabet with our pattern.
For example, if our shift number was 3, then A would be replaced with D, if we performed a right shift. As an example:
Text = "THE CAT IS VISIBLE AT MIDNIGHT" Ciphertext = "WKH FDW LV YLVLEOH DW PLGQLIJKW"
The keys to decrypt this message are the shift number and the direction. The shift value can be any integer from 0 - 25. The above example uses shift = 3 and the shift direction is right or direction = 'r'.
Complete the CipherTest class by adding a constructor to initialize a cipher item. The constructor should initialize the shift to 0, and the direction to 'r' for right shift. If the constructor is called with a shift value, and direction, the constructor should assign each instance attribute with the appropriate parameter value.
Complete the following TODO's: (1) create input for text, shift value, and direction (use lower( )) to keep l and r lower case (2) create a cipher item and use the constructor with the above input values (3) use control structures to call shifttoright() if direction is right and call shifttoleft if direction is left. Make sure you print out the return encrypted message inside the control structures.
We can create the encrypted text by using the ord ( ) function. This function will return an integer that represents the Unicode code point of the character. Character are represented by different values for upp/er and lower case so an 'a' returns the integer 97. By using the unicode value we can add and subtract our shift value represented by an integer.
The given program accepts as input a text string as our message to be encrypted, a shift value, and a direction of 'l' for left and 'r' for right. The program creates a cipher item using the input values. The program outputs the encrypted message based on the shift value and the direction provided.
Ex: If the input is text = "Cryptography is fun!", shift = 4, and direction = l.
The output is:
The output of the text if the shift= 4 and the direction = l would be: Y.N.U.L.P.K.C.N.W.L.D.U E.O B.Q.J
What is Cryptography?This refers to the art of writing and solving codes through the use of ciphertext.
Hence, we can see that the ciphertext we have is that there is a shift of 4 and it moves in the leftward direction thus, using the letters of the English alphabet, we would encode this and the output is: Y.N.U.L.P.K.C.N.W.L.D.U E.O B.Q.J
ABCDEFGHIJKLMNOPQRSTUVWXYZ
Read more about cryptography here:
https://brainly.com/question/88001
#SPJ1
Who was making the high-pitched growling noise that Francisco hears?
The high-pitched growling noise that Francisco hears is due to mating call of male midshipman fish or 5G.
What is the hum about?The Hum is known to be a kind of unexplained happenings that has brought a lot of irritations to people. It is known to be a high-pitched noise that brought a lot of scientific theories.
Studies has shown that the high-pitched growling noise that Francisco hears is as a result of mating call of male midshipman fish or 5G.
Learn more about noise from
https://brainly.com/question/2278957
explain approaches of AI
Answer:
Main AI Approaches
There are three related concepts that have been frequently used in recent years: AI, machine learning, and deep learning.
In a statement: Scanner keyboard = new Scanner (System.in);
it reads user input by means of a Scanner, the user types the line of input below, exactly as shown, including that same spacing.
What is the statement keyboard.nextDouble( ); returned ?
Answer "2": 1+2 is 3 and "5.0" squared is 25.0 !
Answer:
A misMatchException is returned.
Explanation: Keyboard.nextDouble(); is expecting a double as an input and the user entered a string first so an error is returned.
y library> COMP 107: Web Page Design home > 49. LAB Auto loan (CSS) Students: Section 4.9 is a part of 1 assignment Week 7 LAB: Auto Loan (CSS) 4.9 LAB: Auto loan (CSS) Create an external stylesheet so the provided HTML produces the following web page Comparison of Dealer Incentives and Loan Offers Purchase Offer 1 Purchase Offer 2 am Cost Purchase price $33.500 Purchase price Cash incentive rebate $0 Cash incentivebate Loan term (months) 48 Loan term (mores Annual percentage rate (APR) 32 Annual porcentago (APS) Monthly payment 572530 Monthly payment search D O 方 E
This lab requires that you create an external stylesheet to style the web page. You should include elements such as font size, font family, font weight, font style, font color, background color, background image.
What is the elements?Elements are the basic substances that make up all matter in the universe. They are the fundamental building blocks of all matter and are made up of atoms. There are currently 118 known elements, including hydrogen, oxygen, carbon, nitrogen, and iron. Elements are organized on the periodic table according to their chemical and atomic properties. They are classified by their atomic number, number of protons, and chemical properties. When elements combine, they form compounds, which can have properties that are different from the elements that make them up.
To learn more about elements
https://brainly.com/question/29338740
#SPJ1
What is the function of a primary key in a table? to uniquely identify each record in the table to uniquely identify foreign keys in the table to secure table data to secure the foreign keys in the table
Answer:
A. To uniquely identify each record in the table
brainliest pls?
Can anyone help me how to fix this code? The output aren't the same as the datafile. It can't be in a matrix shape in the data file.
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ofstream myfile("Matrix.dat",ios::app);
int A[100][100], B[100][100], row1, co11, row2, co12, i, j, k;
cout << "Enter no. of rows for matrix A: ";
cin >> row1;
cout << "Enter no. of columns for matrix A: ";
cin >> co11;
cout << "Enter no. columns for matrix B: ";
cin >> row2;
cout << "Enter no. of rows for matrix B: ";
cin >> co12 ;
myfile << row1 <<endl;
myfile << co11 <<endl;
myfile << row2 <<endl;
myfile << co12 <<endl;
myfile << endl;
while (co11!=row2)
{
cout << "Sorry! Column of matric A is not equal to row of matrix B.";
cout << "Please enter rows and columns for matrix A: ";
cin >> row1 >> co11;
cout << "Please enter rows and column for the maxtrix B: ";
cin >> row2 >> co12; }
//read matrices
//Storing elements of matrix A
cout << endl << "Enter elements of matrix A:" << endl;
for(i = 0; i < row1; ++i)
for(j = 0; j < co11; ++j)
{
cout << "Enter element A" << i + 1 << j + 1 << " : ";
cin >> A[i][j];
}
//Storing elements of matrix B
cout << endl << "Enter elements of matrix B:" << endl;
for(i=0; i < row2; ++i)
for(j=0; j < co12; ++j)
{
cout << "Enter element B" << i + 1 << j + 1 << " : ";
cin >> B[i][j];
}
//Displaying output of two matrix
{
cout << " \n Matrix A: \n " << endl;
for(i = 0; i < row1; ++i)
{
for(j = 0; j < co11; ++j)
cout << A[i][j] << " ";
cout << endl;
myfile << A[i][j] << " ";
myfile << endl;
}
cout << "\n Matrix B: \n " <<endl;
for(i = 0; i < row2; ++i)
{
for(j = 0; j < co12; ++j)
cout << B[i][j] << " ";
cout << endl;
myfile << B[i][j] << " ";
myfile << endl;
}
return 0;
}
}
Answer:
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ofstream myfile("Matrix.dat", ios::app);
int A[100][100], B[100][100], row1, co11, row2, co12, i, j, k;
cout << "Enter no. of rows for matrix A: ";
cin >> row1;
cout << "Enter no. of columns for matrix A: ";
cin >> co11;
cout << "Enter no. columns for matrix B: ";
cin >> row2;
cout << "Enter no. of rows for matrix B: ";
cin >> co12;
myfile << row1 << endl;
myfile << co11 << endl;
myfile << row2 << endl;
myfile << co12 << endl;
myfile << endl;
while (co11 != row2)
{
cout << "Sorry! Column of matric A is not equal to row of matrix B.";
cout << "Please enter rows and columns for matrix A: ";
cin >> row1 >> co11;
cout << "Please enter rows and column for the maxtrix B: ";
cin >> row2 >> co12;
}
//read matrices
//Storing elements of matrix A
cout << endl << "Enter elements of matrix A:" << endl;
for (i = 0; i < row1; ++i)
for (j = 0; j < co11; ++j)
{
cout << "Enter element A" << i + 1 << j + 1 << " : ";
cin >> A[i][j];
}
//Storing elements of matrix B
cout << endl << "Enter elements of matrix B:" << endl;
for (i = 0; i < row2; ++i)
for (j = 0; j < co12; ++j)
{
cout << "Enter element B" << i + 1 << j + 1 << " : ";
cin >> B[i][j];
}
//Displaying output of two matrix
{
cout << " \n Matrix A: \n " << endl;
for (i = 0; i < row1; ++i)
{
for (j = 0; j < co11; ++j)
{
cout << A[i][j] << " ";
myfile << A[i][j] << " ";
}
myfile << endl;
cout << endl;
}
myfile << endl;
cout << "\n Matrix B: \n " << endl;
for (i = 0; i < row2; ++i)
{
for (j = 0; j < co12; ++j)
{
cout << B[i][j] << " ";
myfile << B[i][j] << " ";
}
myfile << endl;
cout << endl;
}
return 0;
}
}
Explanation:
I believe the issue was just a matter of when << endl; was being used.
My results:
2
2
2
2
1 2
3 4
5 6
7 8
I'm not exactly how this is supposed to look, but based on the image, this seems like the target output format.
Please test this code. If it is not what you were looking for, then tell me what's wrong with the output.
A system is being developed to help pet owners locate lost pets. Which of the following best describes a system that uses crowdsourcing?
A mobile application and collar that uses GPS technology to determine the pet’s location and transmits the location when the owner refreshes the application
A mobile application and collar that uses wireless technology to determine whether the pet is within 100 feet of the owner's phone and transmits a message to the owner when the pet is nearby
A mobile application that allows users to report the location of a pet that appears to be lost and upload a photo that is made available to other users of the application
A mobile application that transmits a message to all users any time a lost pet is returned to its owner
Crowdsourcing is used by mobile application that allows users to report the location of a pet that appears to be lost.
What is a mobile application?A mobile application is known to be a kind of computer app or program that has been made to handle or run itself on a mobile device e.g. phone, etc.
Conclusively, the option that best describes a system that uses crowdsourcing is the mobile application that allows users to report the location of a pet that appears to be lost and upload a photo that is made available to other users of the application and thus everyone can help to look for it.
Learn more about mobile application from
https://brainly.com/question/9477543
#SPJ1
This is your code. >>> A = [21, 'dog', 'red'] >>> B = [35, 'cat', 'blue'] >>> C = [12, 'fish', 'green'] >>> e = [A,B,C] How do you refer to 'green'? e(2, 2) e(2, 2) e(2)(2) e(2)(2) e[2][2] e[2][2] e[2, 2] e[2, 2]
So the final list is
e=[A,B,C]Then
e=[[21,'dog','red'],[35,'Cat','blue'],[12,'fish','green']]green is inside a nested list of index 2
C is at index 2 alsoHence required reference is
e[2][2]Convert 108/10 to binary
Explanation:
The answer would be 1101100
In a portfolio, which document contains the names and contact details of persons who know you professionally?
A. résumé
B. reference letter
C. certificate
D. tracking worksheet
E. brochure
Answer: B: Reference letter
Explanation: yes
. Find the sum of the squares of the integers from 1 to MySquare, where
MySquare is input by the user. Be sure to check that the user enters a positive
integer.
Answer:
in c
Explanation:
#include <stdio.h>
int sumSquares(int n) {
if(n == 0) return 0; else if (n == 1) return 1; else return (n*n) + sumSquares(n - 1);
}
int main() {
int mySquare;
puts("Enter mySquare : ");
scanf("%d", &mySquare);
if(mySquare < 0) mySquare *= -1;// makes mySquare positive if it was negative
printf("Sum of squares: %d", sumSquares(mySquare));
}
The electronic transmission standard for outpatient encounter is
The 837I (Institutional) format is the standard format used by institutional providers to electronically communicate health care claims.
The probability of event A occurring is 10/10. The probability of event B occurring is 0/10. What is the entropy of this system? Please show work.
The events A and B are the outcomes of the probabilities in the system
The entropy of the system is 0
How to determine the entropy?The probabilities are given as:
P(A) = 10/10
P(B) = 0/10
The entropy is calculated using:
[tex]H(x) = -\sum \limits^{n}_{i = 1} p_i * \log_2(p_i)[/tex]
So, we have
[tex]H(x) = -10/10 * \log_2(10/10) - 0/10 * \log_2(0/10)[/tex]
Evaluate the products
[tex]H(x) = -\log_2(10/10) - 0[/tex]
Evaluate the sum
[tex]H(x) = -\log_2(10/10)[/tex]
Evaluate the quotient
[tex]H(x) =- \log_2(1)[/tex]
Express 1 as 2^0
[tex]H(x) =- \log_2(2^0)[/tex]
Apply the power rule of logarithm
[tex]H(x) =- 0\log_2(2)[/tex]
Evaluate the product
H(x) =0
Hence, the entropy of the system is 0
Read more about probability at:
https://brainly.com/question/25870256
An information system can enhance core competencies by
Answer:
An information system can enhance core competencies by: encouraging the sharing of knowledge across business units.
Explanation:
Hope this helps you ! please mark me brainless
What is installing?
the process of putting new software on a computer
the process of replacing an older version of software with a newer version
O the process of limiting who is allowed to access your information
O the process of programming a language to use on a web page
The process of putting new software on a computer
drive.
safely*
How many years was Eric sentenced to prison?
life
22 years
30 years
5 years
Answer:
22
Explanation:
what were the results of Dr.bjork's experiment
Answer:
Studying in different rooms seemed to improve a persons memory
Write a short note on Ms - Excel.....
Answer:
Microsoft Excel is a spreadsheet program. It provides a grid interface to organize the various information. You can use Excel to create and format workbooks in order to analyse the data. Specifically, you can use Excel to track data, build models for analysing data, write formulas to perform calculations on that data, pivot the data in various ways, and present data in a variety of professional looking charts. Excel is used widely in financial activity. It has the ability to create new spreadsheets where users can define custom formulas for the calculation. Excel is also used widely for common information organization and tracking like a list of sales leads, project status reports, contact lists, and invoicing. Excel is also useful tool for scientific and statistical analysis with large data sets.
Spam is _____.
a set of rules that you should follow when sending e-mail
a set of rules that you should follow when sending e-mail
an example of an ethical use of email
an example of an ethical use of email
the practice of sending unwanted messages to a large group of people
the practice of sending unwanted messages to a large group of people
a type of attachment
Answer:
any kind of unwanted, unsolicited digital communication that gets sent out in bulk
Select the correct text in the passage.
Which of the following statements is true with regards to satellite Internet access?
It is cheap.
It is the slowest internet access technology.
It can be used in rural and remote areas.
It requires direct line-of-sight to work.
It requires major installation of new infrastructure.
It covers a large geographical area.
Bruno is a network engineer who is tasked with adding a separate layer of protection to the control plane of a router. He wants messages with a bps (bits per second) rate below the threshold 7000 to be transmitted and the messages with a threshold above 7000 to be dropped. Analyze which of the following commands Bruno should use in pmap configuration mode in this scenario.
A network engineer has the duty of protecting a network from external or internal attacks that wants to compromise the integrity of the network.
What is Control Plane Policing?This refers to one of the ways of protecting the control plane by policing the traffic coming into it.
The use of control plane policing is the feature that Bruno is making use of as he wants messages with a bps (bits per second) rate below the threshold of 7000 to be transmitted and the messages with a threshold above 7000 to be dropped.
Please note that your question is incomplete so I gave you a general overview to help you get a better understanding of the concept.
#SPJ1
Read more about network security here:
https://brainly.com/question/25720881
How has motherboard evolved over time ?
Answer:
more devices were integrated into the motherboard.
Explanation:
It was a slow trend initially though, as I/O ports and disk controllers
What is the output of this program? Assume the user enters 3, 6, and 11.
numA = 0
for count in range(3):
answer = input ("Enter a number: ")
fltAnswer = float(answer)
numA = numA + fltAnswer
print (numA)
Answer: 20
That would be the sum of 3, 6 and 11.
Explanation:
numA = 0
This step creates a variable called num A with the value of zero.
for count in range(3):
This step repeats our following 3 lines of code 3 times.
answer = input ("Enter a number: ")
This line of code creates and sets the variable "answer" to the
value of what the user enters.
fltAnswer = float(answer)
This step converts our prevous user input which was a string into a
float. This is were the code screams if you were to enter a character
instead of a number.
numA = numA + fltAnswer
This step adds the user input to the variable numA.
Or more correct:
This step sets the variable numA to its previous value plus the user
input.
print (numA)
This step prints out numA. This line is also outside of the loop and
will only activate once when the loop ends.
Sarah has to draw a shape that looks like a revolving circle for her class project in technical drawing. What should Sarah draw?
A cylinder
B. cone
C. sphere
D. ellipsoid
E. prism
The drawing that Sarah should draw so that it looks like a revolving circle for her class project in technical drawing is a sphere.
What is a sphere?
A sphere is a three-dimensional equivalent of a two-dimensional circle. A sphere is a collection of points in three-dimensional space that are all the same distance r from a particular point.
Despite the fact at which angle you look, a sphere always looks like a circle. This property of the sphere can be used by Sarah. And hence, the drawing that Sarah should draw so that it looks like a revolving circle for her class project in technical drawing is a sphere.
Learn more about Sphere:
https://brainly.com/question/11374994
#SPJ1
what devices do not allow data stored on them to be modified.
Answer:
Read-only memory (ROM) is a type of non-volatile memory used in computers and other electronic devices. Data stored in ROM cannot be electronically modified after the manufacture of the memory device.
In this lab, you add a loop and the statements that make up the loop body to a C++ program that is provided. When completed, the program should calculate two totals: the number of left-handed people and the number of right-handed people in your class. Your loop should execute until the user enters the character X instead of L for left-handed or R for right-handed.
The inputs for this program are as follows: R, R, R, L, L, L, R, L, R, R, L, X
Variables have been declared for you, and the input and output statements have been written.
Instructions
Ensure the source code file named LeftOrRight.cpp is open in the code editor.
Write a loop and a loop body that allows you to calculate a total of left-handed and right-handed people in your class.
Execute the program by clicking the Run button and using the data listed above and verify that the output is correct.
// LeftOrRight.cpp - This program calculates the total number of left-handed and right-handed
// students in a class.
// Input: L for left-handed; R for right handed; X to quit.
// Output: Prints the number of left-handed students and the number of right-handed students.
#include
#include
using namespace std;
int main()
{
string leftOrRight = ""; // L or R for one student.
int rightTotal = 0; // Number of right-handed students.
int leftTotal = 0; // Number of left-handed students.
// This is the work done in the housekeeping() function
cout << "Enter an L if you are left-handed, a R if you are right-handed or X to quit: ";
cin >> leftOrRight;
// This is the work done in the detailLoop() function
// Write your loop here.
// This is the work done in the endOfJob() function
// Output number of left or right-handed students.
cout << "Number of left-handed students: " << leftTotal << endl;
cout << "Number of right-handed students: " << rightTotal << endl;
return 0;
}
Answer:
#include <iostream>
#include <string>
// R, R, R, L, L, L, R, L, R, R, L, X ==> 6R 5L X
void getLeftOrRight(std::string &l_or_r, int &total_l, int &total_r) {
// notice how the above line matches: getLeftOrRight(leftOrRight, leftTotal, rightTotal);
// the values provided from the loop are given nicknames for this function getLeftOrRight()
if (l_or_r == "L") { // left-handed
total_l++;
} else if (l_or_r == "R") { // right-handed
total_r++;
} else { // quit
// option must be "X" (quit), so we do nothing!
}
return; // we return nothing, which is why the function is void
}
int main() {
std::string leftOrRight = ""; // L or R for one student.
int rightTotal = 0; // Number of right-handed students.
int leftTotal = 0; // Number of left-handed students.
while (leftOrRight != "X") { // whilst the user hasn't chosen "X" to quit
std::cout << "Pick an option:" << std::endl;
std::cout << "\t[L] left-handed\n\t[R] right-handed\n\t[X] quit\n\t--> ";
std::cin >> leftOrRight; // store the user's option in the variable
getLeftOrRight(leftOrRight, leftTotal, rightTotal); // call a function, and provide it the 3 arguments
}
std::cout << "Number of left-handed students: " << leftTotal << std::endl;
std::cout << "Number of right-handed students: " << rightTotal << std::endl;
return 0;
}
Explanation:
This is my take on the question! I had no idea what was meant by the housekeeping(), detailLoop(), endOfJob() functions provided in their source code.
What my code does should be pretty explanatory via the comments and variable names within it — but feel free to make a comment to ask for more info! I've attached a screenshot of my code because I think it's easier to read when it's syntax highlighted with colors.
In this code, the while loop continues to execute as long as the user enters something other than 'X'.
You need to write a loop that repeatedly takes input from the user and updates the leftTotal and rightTotal variables based on the input until the user enters 'X' to quit.
Here's the completed code:
#include <iostream>
using namespace std;
int main()
{
string leftOrRight = ""; // L or R for one student.
int rightTotal = 0; // Number of right-handed students.
int leftTotal = 0; // Number of left-handed students.
cout << "Enter an L if you are left-handed, a R if you are right-handed or X to quit: ";
cin >> leftOrRight;
// Write your loop here.
while (leftOrRight != "X") {
if (leftOrRight == "L") {
leftTotal++;
} else if (leftOrRight == "R") {
rightTotal++;
}
cout << "Enter an L if you are left-handed, a R if you are right-handed or X to quit: ";
cin >> leftOrRight;
}
cout << "Number of left-handed students: " << leftTotal << endl;
cout << "Number of right-handed students: " << rightTotal << endl;
return 0;
}
In this code, the while loop continues to execute as long as the user enters something other than 'X'.
Inside the loop, the input is checked for either 'L' or 'R', and the appropriate total variable is incremented accordingly.
The loop then prompts the user for input again until the user decides to quit by entering 'X'.
Finally, the code displays the total number of left-handed and right-handed students.
Learn more about C++ program click;
https://brainly.com/question/33180199
#SPJ3
2. Write the pseudocode to print all multiples of 5 between 10 and 25 (including both
10 and 25)
Answer:
Read code below
Explanation:
n = 10
while n is <= 25{
print(n)
n +=5
}
This while loop will print all multiples of 5 between 10 and 25 by starting with 10 as n, printing n, then incrementing n by 5 until n is greater than 25.
Thabo has a small barber shop and he uses Microsoft applications to keep track of his stock and to create posters for advertising his barber shop. Thabo is worried about customers coming to the barber shop during the pandemic, as there might be difficulties adhering to social distancing rules and controlling overcrowding. You have informed Thabo about a great information system that could be used by his customers to place book for specific time slots as well as communicating with Thabo. Thabo needs some convincing about implementing a computerised information system.
Q.1.1 In your quest to convince discuss at least five benefits of implementing an information system in Thabo’s business.
Q.1.2 Thabo understand the benefits of implementing an Information system in his business. However, Thabo requires more information regarding what entails a successful information system.
Discuss, using appropriate examples, the components of an Information system and their role applicable to Thabo’s barber shop
An information system is crucial to the success of a business. Itemized below are five benefits of operating an information system in a business.
What are the benefits of an Information System?Information systems are important because:
An information system requires the following:
Hardware for the computer workstation and addendumsSoftwareA network communication amongst the computers and hardwarea map of the company's processes and the people responsible for such processesA procedural manual.Existing data from the business.For the barber's shop, for example, some of the components of the information system he must put in place are:
A workstation that collects information about:
ClientsDetails of SalesExpensesCompliance dates and records etc.Learn more about Information Systems at:
https://brainly.com/question/25226643
why 4gl is called non procedural language? explain in detail.
Answer:
h The user, not the computer, specifies what is desired in terms of application.