Python high school assignment: please keep simpleIn pythonInstructionsUse the following initializer list:w = ["Algorithm", "Logic", "Filter", "Software", "Network", "Parameters", "Analyze", "Algorithm", "Functionality", "Viruses"]Write a loop that prints the words in uppercase letters.Sample RunALGORITHMLOGICFILTERSOFTWARENETWORKPARAMETERSANALYZEALGORITHMFUNCTIONALITYVIRUSES

Answers

Answer 1

Answer:

w = ["Algorithm", "Logic", "Filter", "Software", "Network", "Parameters", "Analyze", "Algorithm", "Functionality", "Viruses"]

for i in range (len(w)):

   print(w[i].upper())

Explanation:

every element needs to be upper cased

Answer 2

A loop that prints the words in uppercase letters is written below with the help of Python.

What is a function?

Simply said, a function is a "chunk" of code that you may reuse repeatedly so instead of having to write it out several times. Software developers can divide an issue into smaller, more manageable parts, which can each carry out a specific task, using functions.

A function, according to a technical definition, is a relationship between an amount of parameters and a set of potential outputs, where every other input is connected to precisely one output.

All the functions are to be written in uppercase:

w = ["Algorithm", "Logic", "Filter", "Software", "Network", "Parameters", "Analyze", "Algorithm", "Functionality", "Viruses"]

for i in range (len(w)):

  print(w[i].upper())

Learn more about function, Here:

https://brainly.com/question/29050409

#SPJ5


Related Questions

Next, Su wants to explain how the cotton gin separated seeds from cotton. At first, she considers using star bullets for
the steps in this process. But then, she determines that is not the right approach. Which action would most clearly
show the steps in the process in her presentation?
Su should change the type of bullet.
Su should change the size of the bullets.
Su should change the bullets to numbers.
Su should change the color of the bullets.​

Answers

Answer:

change bullets to numbers

Explanation:

100%

Identify a logical operation (along
with a corresponding mask) that, when
applied to an input string of 8 bits,
produces an output string of all 0s if and
only if the input string is 10000001.​

Answers

Answer: Provided in the explanation section

Explanation:

The Question says;

Identify a logical operation (along

with a corresponding mask) that, when

applied to an input string of 8 bits,

produces an output string of all 0s if and

only if the input string is 10000001.​

The Answer (Explanation):

XOR, exclusive OR only gives 1 when both the bits are different.

So, if we want to have all 0s, and the for input only 10000001, then we have only one operation which satisfies this condition - XOR 10000001. AND

with 00000000 would also give 0,

but it would give 0 with all the inputs, not just 10000001.

Cheers i hope this helped !!

What is a large public computer network through which computers can exchange information at high speed?​

Answers

Answer:

Server

Explanation:

The Question is vauge, but I believe a Server is the word you're looking for. Computer Network could mean various things, in this case im going to assume that by Network, its saying Server. As a server is what allows for high speed interactions between a host computer and a client computer.

Consider that a large online company that provides a widely used search engine, social network, and/or news service is considering banning ads for the following products and services from its site: e-cigarettes, abortion clinics, ice cream, and sugared soft drinks. Which, if any, do you think they should ban? Give reasons. In particular, if you select some but not all, explain the criteria for distinguishing.

Answers

Answer:

I think that they should ban ads for all four products.  These products, e-cigarettes, abortion clinics, ice cream, and sugared soft drinks, are all discreet adult products that should not be advertised because of their health hazards.  Since the "large online company provides a widely used search engine, social network, and/or news service, which are mainly patronized by younger people, such ads that promote products injurious to individual health should be banned.  Those who really need or want these products know where they could get them.  Therefore, the products should not be made easily accessible to all people.  Nor, should ads promote their patronage among the general population.

Explanation:

Advertisements create lasting and powerful images which glamourize some products, thereby causing the general population, especially children, to want to consume them without any discrimination of their health implications.  If online banning is then contemplated, there should not be any distinguishing among the four products: e-cigarettes, abortion clinics, ice cream, and sugared soft drinks.

In the lab, you defined the information systems security responsibility for each of the seven domains of a typical IT infrastructure. In which domain are you most likely to find service provider service level agreements (SLAs), managed security services, monitoring, and reporting?

Answers

Answer:

LAN/WAN domain

Explanation:

This is the boundary between trusted adn untrusted zones. All SLA's, managed security services, their monitoring and reporting is done by this domain.

) If FIFO page replacement is used with five page frames and eight pages, how many page faults will occur with the reference string 236571345157245 if the five frames are initially empty?

Answers

Answer:

There are a total of 8 page faults.

Explanation:

In FIFO page replacement, the requests are executed as they are received. The solution is provided in the attached figure. The steps are as follows

Look for the digit in the pages. if they are available, there is no page fault. If the digit does not exist in the page frames it will result in an error.

Write a function called unzip that takes as parameter a sequence (list or tuple) called seq of tuples with two elements. The function must return a tuple where the first element is a list with the first members of the seq tuple and the second element is a list with the second members of the seq tuple.
This example clarifies what is required:
Ist =[(1, "one"), (2, "two"), (3, "three")]
tup= unzip(Lst) lst tup
print(tup)
#prints ([1, 2, 3], ['one', two','three'7)

Answers

Answer:

Here is the function unzip:

def unzip(lst):

   result= zip(*lst)

   return list(result)

The complete program in Python is given below:

def unzip(lst):

   result= zip(*lst)

   return list(result)

   

lst =[(1, "one"), (2, "two"), (3, "three")]

tup= unzip(lst)

print(tup)

Explanation:

Here zip() function is used in the unzip function. The return type of zip() function is a zip object. This means the function returns the iterator of tuples. This function can be used as its own inverse by using the * operator.

If you do not want to use zip() function then the above program can also be implemented as following which uses a for loop for elements in the given list (lst). This can make a pair of lists (2 tuple) instead of list of tuples:

def unzip(lst):

   output = ([ a for a,b in lst ], [ b for a,b in lst ])

   return output

   

lst =[(1, "one"), (2, "two"), (3, "three")]  

tup= unzip(lst)  

print(tup)

The programs along with their output are attached.

Write a program in C# : Pig Latin is a nonsense language. To create a word in pig Latin, you remove the first letter and then add the first letter and "ay" at the end of the word. For example, "dog" becomes "ogday" and "cat" becomes "atcay". Write a GUI program named PigLatinGUI that allows the user to enter a word and displays the pig Latin version.

Answers

Answer:

The csharp program is as follows.

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;  

namespace WindowsFormsApplication1

{

   public partial class Form1 : Form

   {

       public Form1()

       {

           InitializeComponent();

       }

private void button1_Click(object sender, EventArgs e)

       {

           string word = textBox1.Text;

               string  ch = word.Substring(0, 1);

               string str = word.Substring(1, word.Length-1);

               string s = str.Insert(str.Length, ch);

               textBox2.Text = s.Insert(s.Length, "ay");            

       }

     private void button3_Click(object sender, EventArgs e)

       {

           Close();

       }

       private void button2_Click(object sender, EventArgs e)

       {

           textBox1.Text = "";

           textBox2.Text = "";

       }

   }

}

Explanation:

1. A string variable to hold the user input is declared and initialized accordingly. The user inputted string is taken from textbox1.

string word = textBox1.Text;

2. A string variable to hold the first character of the user inputted string is declared and initialized.

string  ch = word.Substring(0, 1);

3. A string variable to hold the user inputted string without the first character is declared and initialized accordingly.

string str = word.Substring(1, word.Length-1);

4. A string variable to hold the substring from step 3 along with the inserted characters at the end, is declared and initialized accordingly.

string s = str.Insert(str.Length, ch);

5. The final string is assigned to the textbox 2, which is the PigLatin conversion of the user inputted string.

textBox2.Text = s.Insert(s.Length, "ay");

6. All the above take place when the user clicks Convert to PigLatin button.

7. Two additional buttons, clear and exit are also included in the form.  

8. When the user clicks clear button, both the textboxes are initialized to empty string thus clearing both the textboxes.

 textBox1.Text = "";

           textBox2.Text = "";

9. When the user clicks the exit button, the application closes using the Close() method.

10. The program is done in Visual Studio.

11. The output of the program is attached.

12. The program can be tested for any type of string and any length of the string.

Two of the most fundamental functions for dealing with interprocess communication are read() and write(). Consider the following otherwise valid C program:int r, pipeFDs[2];
char message[512];
pid_t spawnpid;

pipe(pipeFDs);
spawnpid = fork();

switch (spawnpid)
{
case 0:
close(pipeFDs[0]); // close the input file descriptor
write(pipeFDs[1], "hi process, this is the STUFF!!", 21);
break;

default:
close(pipeFDs[1]); // close output file descriptor
r = read(pipeFDs[0], message, sizeof(message));
printf("Message received from other: %s\n", message);
break;
}

Select each of the following answers that is correct. CAN BE MULTIPLE CHOICES...
(1) The read() call may block until data becomes available
(2) When the read() call returns, this one call will return all of the data that was sent through the pipe, which is different behavior than if this was a socket
(3) If the read() call blocks, the process will be suspended until data arrives
(4) The write() call will return before all of the data has been written, if the corresponding read() call blocks mid-transfer
(5) Pipes can fill, which will cause the write() call to block until the read() call is able to read data from the pipe

Answers

Answer: Provided in the explanation section

Explanation:

int r, pipeFDs[2];

char message[512];

pid_t spawnpid;

pipe(pipeFDs);

spawnpid = fork();

switch (spawnpid)

{

case 0:

close(pipeFDs[0]); // close the input file descriptor

write(pipeFDs[1], "hi process, this is the STUFF!!", 21);

break;

default:

close(pipeFDs[1]); // close output file descriptor

r = read(pipeFDs[0], message, sizeof(message));

printf("Message received from other: %s\n", message);

break;

}

Observation of the program:

The read() call may block until data becomes available If the read() call blocks, the process will be suspended until data arrives Pipes can fill, which will cause the write() call to block until the read() call is able to read data from the pipe

⇒ Therefore,Option 1,3 and 5 correct

Cheers i hope this helped !!!

Write a C++ program to find if a given array of integers is sorted in a descending order. The program should print "SORTED" if the array is sorted in a descending order and "UNSORTED" otherwise. Keep in mind that the program should print "SORTED" or "UNSORTED" only once.

Answers

Answer:

The cpp program for the given scenario is as follows.

#include <iostream>

#include <iterator>

using namespace std;

int main()

{

   //boolean variable declared and initialized  

   bool sorted=true;

   //integer array declared and initialized

   int arr[] = {1, 2, 3, 4, 5};

   //integer variables declared and initialized to length of the array, arr

   int len = std::end(arr) - std::begin(arr);

       //array tested for being sorted

    for(int idx=0; idx<len-1; idx++)

    {

        if(arr[idx] < arr[idx+1])

           {

               sorted=false;

            break;

           }

    }

    //message displayed  

    if(sorted == false)

     cout<< "UNSORTED" <<endl;

 else

    cout<< "UNSORTED" <<endl;

return 0;

}

OUTPUT

UNSORTED

Explanation:

1. An integer array, arr, is declared and initialized as shown.

int arr[] = {1, 2, 3, 4, 5};

2. An integer variable, len, is declared and initialized to the size of the array created above.

int len = std::end(arr) - std::begin(arr);

3. A Boolean variable, sorted, is declared and initialized to true.

bool sorted=true;  

4. All the variables and array are declared inside main().

5. Inside for loop, the array, arr, is tested for being sorted or unsorted.  The for loop executes over an integer variable, idx, which ranges from 0 till the length of the array, arr.

6. The array is assumed to be sorted if all the elements of the array are in descending order.

7. If the elements of the array are in ascending order, the Boolean variable, sorted, is assigned the value false and for loop is exited using break keyword. The testing is done using if statement.

8. Based on the value of the Boolean variable, sorted, a message is displayed to the user.

9. The program can be tested for any size of the array and for any order of the elements, ascending or descending. The program can also be tested for array of other numeric data type including float and double.

10. All the code is written inside the main().

11. The length of the array is found using begin() and end() methods as shown previously. For this, the iterator header file is included in the program.

Which component allows you to enjoy cinematic
or 3-D effects on your computer?
A.Cache memory
B.Ethernet port
C.external hard drive
D.video and sound cards

Answers

external hard drive

external hard drive

Answer:

Amswer would be D

Explanation:

2) An algorithm that takes in as input an array with n rows and m columns has a run time of O(nlgm). The algorithm takes 173 ms to run in an input array with 1000 rows and 512 columns. How long will the algorithm take to run on an input array with 1500 rows and 4096 columns? (Note: For ease of calculation, please use a base of 2 for your logarithm.)

Answers

Answer:

The algorithm takes 346 ms to run on an input array with 1500 rows and 4096 columns.

Explanation:

For an input array with 1000 rows and 512 columns, the algorithm takes 173 ms.

We want to find out how long will the algorithm take to run on an input array with 1500 rows and 4096 columns?

Let the algorithm take x ms to run 1500 rows and 4096 columns.

For an input of n rows and m columns, it takes

[tex]n \: log_{2} \:m[/tex]

So,

[tex]1000 \: log_{2} \:512 = 173 \\\\1000 \: log_{2} \:2^{9} = 173 \:\:\: ( 2^{9} = 512) \\\\1000 \times 9 = 173 \:\:\:\:\: \: \: eg. 1[/tex]

and

[tex]1500 \: log_{2} \:4096 = x \\\\1500 \: log_{2} \:2^{12} = x \:\:\: ( 2^{12} = 4096) \\\\1500 \times 12 = x \:\:\:\:\: \: \: eg. 2[/tex]

Now divide the eq. 2 by eq. 1 to find the value of x

[tex]\frac{1500 \times 12}{1000 \times 9} = \frac{x}{173} \\\\\frac{18000 }{9000} = \frac{x}{173} \\\\2 = \frac{x}{173} \\\\x = 2 \times 173 \\\\x = 346 \: ms[/tex]

Therefore, the algorithm takes 346 ms to run on an input array with 1500 rows and 4096 columns.

The IBM 370 mainframe computer was introduced in 1970. The 370 Model 145 could hold up to 524,288 bytes of data (512 Kbytes). It cost $1,783,000.00 to buy (or $37,330/month to rent). A notebook computer today holds 16 Gbytes of memory and costs $2,500 to buy. If you assume that 100% of the price is just the memory, for both computers:
• how much did 1 Kbyte of memory in the IBM computer cost?
• how much does 1 Kbyte of memory in the laptop cost?
• how many times cheaper is the memory in the laptop than memory in the mainframe?
• what factor is today’s computer cheaper than the IBM 370?

Answers

Answer:

a) $3482.4 per Kbyte

b) $0.000149 per Kbyte

c) The laptop is 23369991 times cheaper than the mainframe computer

d) Today's computer is 23369991 times cheaper than IBM 370

Explanation:

a) The 370 Model 145 could hold up to 524,288 bytes of data

one Kb = 1024 bytes, therefore  524,288 bytes =  524288/1024 Kbytes= 512 Kbytes. It cost $1,783,000.00 to buy (or $37,330/month to rent).

Since 100% of the price is just the memory

Cost per 1 Kb = cost of computer / memory

Cost per 1 Kb =  $1,783,000 / 512 Kb = $3482.4 per Kbyte

b)   A notebook computer today holds 16 Gbytes of memory

one Kb = 1024 bytes, 1024 Kb = 1 Mbyte, 1024 Mbytes = 1 Gbyte.

Therefore 16 Gbytes =  (16 * 1024 * 1024) Kbytes = 16777216 Kbytes. It cost $2500 to buy

Since 100% of the price is just the memory

Cost per 1 Kb = cost of computer / memory

Cost per 1 Kb =  $2500 /16777216 Kb = $0.000149 per Kbyte

c) Cost per 1 Kb for mainframe/ Cost per 1 Kb for laptop = $3482.4 per Kbyte / $0.000149 per Kbyte = 23369991

The laptop is 23369991 times cheaper than the mainframe computer

d) Today's computer is 23369991 times cheaper than IBM 370

Alcatel-Lucent's High Leverage Network (HLN) increases bandwidth and network capabilities while reducing the negative impact on the environment. This works because the HLN:_____________.
a. Reduces or eliminates use of finite (non-renewable) radio frequencies utilized by wireless devices.
b. Reduces Radio Frequency Interference (RFI) - overcrowding of specific areas of the electromagnetic spectrum.
c. Limits the number of people who can access the network at any one time —particularly during times of peak energy demand.
d. Delivers increased bandwidth using fewer devices and energy.

Answers

Answer:

d. Delivers increased bandwidth using fewer devices and energy.

Explanation:

Alcatel-Lucent, formed in 1919 was a French global telecommunications equipment manufacturing company with its headquarter in Paris, France.

They provide services such as telecommunications and hybrid networking solutions deployed both in the cloud and properties.

Alcatel-Lucent's High Leverage Network (HLN) increases bandwidth and network capabilities while reducing the negative impact on the environment. This works because the High Leverage Network (HLN) delivers increased bandwidth using fewer devices and energy on Internet Protocol (IP) networks.

The Alcatel-Lucent's High Leverage Network (HLN) provides reduced cost of transmitting data as fewer network equipments are used with less adverse effects on the environment.

The High Leverage Network (HLN) when successfully implemented helps telecom firms to improve their operational efficiency, maintenance costs, and enhance network performance and capacity to meet the bandwidth demands of their end users.

What’s the best way to figure out what wires what and goes where?

Answers

Try to untangle them, First!
Then the color of the wire must match the color hole it goes in (I’m guessing)
I’m not good with electronics so sorry.

C++ Problem: In the bin packing problem, items of different weights (or sizes) must be packed into a finite number of bins each with the capacity C in a way that minimizes the number of bins used. The decision version of the bin packing problem (deciding if objects will fit into <= k bins) is NPcomplete. There is no known polynomial time algorithm to solve the optimization version of the bin packing problem. In this homework you will be examining three greedy approximation algorithms to solve the bin packing problem.

- First-Fit: Put each item as you come to it into the first (earliest opened) bin into which it fits. If there is no available bin then open a new bin.

- First-Fit-Decreasing: First sort the items in decreasing order by size, then use First-Fit on the resulting list.

- Best Fit: Place the items in the order in which they arrive. Place the next item into the bin which will leave the least room left over after the item is placed in the bin. If it does not fit in any bin, start a new bin.

Implement the algorithms in C++. Your program named bins.cpp should read in a text file named bin.txt with multiple test cases as explained below and output to the terminal the number of bins each algorithm calculated for each test case. Example bin.txt: The first line is the number of test cases, followed by the capacity of bins for that test case, the number of items and then the weight of each item. You can assume that the weight of an item does not exceed the capacity of a bin for that problem.

3

10

6

5 10 2 5 4 4

10

20

4 4 4 4 4 4 4 4 4 4 6 6 6 6 6 6 6 6 6 6

10

4

3 8 2 7

Sample output: Test Case 1 First Fit: 4, First Fit Decreasing: 3, Best Fit: 4

Test Case 2 First Fit: 15, First Fit Decreasing: 10, Best Fit: 15

Test Case 3 First Fit: 3, First Fit Decreasing: 2, Best Fit: 2

Answers

xekksksksksgBcjqixjdaj

Write a function to_pig_latin that converts a word into pig latin, by: Removing the first character from the start of the string, Adding the first character to the end of the string, Adding "ay" to the end of the string. So, for example, this function converts "hello"to "ellohay". Call the function twice to demonstrate the behavior. There is a worked example for this kind of problem.

Answers

Answer:

def to_pig_latin(word):

   new_word = word[1:] + word[0] + "ay"

   return new_word

print(to_pig_latin("hello"))

print(to_pig_latin("latin"))

Explanation:

Create a function called to_pig_latin that takes one parameter, word

Inside the function, create a new_word variable and set it to the characters that are between the second character and the last character (both included) of the word (use slicing) + first character of the word + "ay". Then, return the new_word.

Call the to_pig_latin function twice, first pass the "hello" as parameter, and then pass the "latin" as parameter

Answer:

...huh?

Explanation:

Remember to save _____ and be certain that you have your files saved before closing out.

Answers

It could be ‘save as’ or ‘your work’, not completely sure

You have decided that the complexity of the corporate network facility and satellite offices warrants the hiring of a dedicated physical security and facilities protection manager. You are preparing to write the job requisition to get this critical function addressed and have solicited some ideas from the PCS working group members regarding physical and environmental security risks. Discuss the operational security functions that the physical security and facilities protection manager would be responsible for. Discuss how these functions would inform the development and implementation of system related incident response plans. Further discuss how these incident response plans fit into business continuity planning. Include at least one research reference and associated in-text citation using APA standards. In yourreplies to your peers further discuss how the concepts improve the security posture of PCS.

Answers

Answer:

All organizational security functions are as follows:  

i) Classify any vital data  

ii) Analyze of the hazard  

iii) Analyze vulnerability  

iv) Assess the risk  

v) Take the appropriate risk prevention measures.

Explanation:

These methods described the incident that will fit into this business model was its ongoing support and control of its system that involves the improvements and fix bugs.  For above-mentioned mechanisms aid in evaluating potential events/attacks and help reduce the risk involved with these, as well as promote network security by reducing the likelihood of any harm.  In this case, appropriate monitoring and monitoring should be a must.

Given main(), define the Team class (in file Team.java). For class method getWinPercentage(), the formula is:teamWins / (teamWins + teamLosses)Note: Use casting to prevent integer division.Ex: If the input is:Ravens133 where Ravens is the team's name, 13 is number of team wins, and 3 is the number of team losses, the output is:Congratulations, Team Ravens has a winning average!If the input is Angels 80 82, the output is:Team Angels has a losing average.Here is class WinningTeam:import java.util.Scanner;public class WinningTeam {public static void main(String[] args) {Scanner scnr = new Scanner(System.in);Team team = new Team();String name = scnr.next();int wins = scnr.nextInt();int losses = scnr.nextInt();team.setTeamName(name);team.setTeamWins(wins);team.setTeamLosses(losses);if (team.getWinPercentage() >= 0.5) {System.out.println("Congratulations, Team " + team.getTeamName() +" has a winning average!");}else {System.out.println("Team " + team.getTeamName() +" has a losing average.");}}}

Answers

Answer:

Explanation:

public class Team {

   private String teamName;

   private int teamWins;

   private int teamLosses;

   public String getTeamName() {

       return teamName;

   }

   public void setTeamName(String teamName) {

       this.teamName = teamName;

   }

   public int getTeamWins() {

       return teamWins;

   }

   public void setTeamWins(int teamWins) {

       this.teamWins = teamWins;

   }

   public int getTeamLosses() {

       return teamLosses;

   }

   public void setTeamLosses(int teamLosses) {

       this.teamLosses = teamLosses;

   }

   public double getWinPercentage() {

       return teamWins / (double) (teamWins + teamLosses);

   }

}

Following are the Java program to define the Team class and calculate its  value:

Class Definition:

class Team //defining the class Team

{

   private String teamName;//defining String variable

   private int teamWins, teamLosses;//defining integer variable

   //defining the set method to set value the input value

   public void setTeamName(String teamName)//defining setTeamName method that takes one String parameter

   {

       this.teamName = teamName;//using this keyword that sets value in teamName

   }

   public void setTeamWins(int teamWins) //defining setTeamWins method that takes one integer parameter

   {

       this.teamWins = teamWins;//using this keyword that sets value in teamWins

   }

   public void setTeamLosses(int teamLosses)//defining setTeamLosses method that takes one integer parameter

   {

       this.teamLosses = teamLosses;//using this keyword that sets value in teamLosses

   }

   //defining the get method that returns the input value

   public String getTeamName() //defining getTeamName method

   {

       return teamName;//return teamName value

   }

   public int getTeamWins()  //defining getTeamWins method

   {

       return teamWins;//return teamWins value

   }

   public int getTeamLosses() //defining getTeamLosses method

   {

       return teamLosses;//return teamLosses value

   }

   public double getWinPercentage()//defining getWinPercentage method

   {              

       return ((teamWins * 1.0) / (teamWins + teamLosses));//using the return keyword that returns percentage value

   }      

}

Please find the complete code in the attached file and its output file in the attached file.

Class definition:

Defining the class "Team".Inside the class two integer variable "teamWins, teamLosses" and one string variable "teamName" is declared.In the next step, the get and set method is defined, in which the set method is used to set the value, and the get method is used to return the value.

Find out more about the Class here:

brainly.com/question/17001900

What did Aristotle teach?

Answers

Philosophy, I beleive. He tought Sikander liturature and eloquence, but his most famous teachings were of philosophy.

Aristotle taught the world science. He was considered the best scientists of his time.

a. A programmer wrote a software delay loop that counts the variable (unsigned int counter) from 0 up to 40,000 to create a small delay. If the user wishes to double the delay, can they simply increase the upperbound to 80,000?
b. If the code contains a delay loop and we noticed that no delay is being created at run-time. What should we suspect during debugging?

Answers

Answer:

Explanation:

The objective here is to determine if the programmer can simply increase the upperbound to 80,000.

Of course Yes, The programmer can simply increase the delay by doubling the upperbound by 80000. The representation can be illustrated as:

( int : i = 0;  i <  40,000; i ++ )

{

  // delay code

}

Which can be modified as:

( int : i = 0;  i <  80,000; i ++ )

{

  // delay code

}

b)  If the code contains a delay loop and we noticed that no delay is being created at run-time. What should we suspect during debugging?

Assuming there is no delay being created at the run-time,

The code is illustrated as:

For ( int : i = 0 ; i < 0 ; i ++ )

{

  // delay code which wont

  //execute since code delay is zero

}

we ought to check whether the loop is being satisfied or not.  At the Initial value of loop variable, is there any break or exit statement is being executed in between loop. Thus, the  aforementioned delay loop wont be executed since the loop wont be executed for any value of i.

The main() module in the starter code below takes integar inputs separated by commas from the user and stores them in a list. Then, it allows the user to manipulate the list using 3 functions:
mutate_list() takes 3 parameters -- a list, index number, and a value -- and inserts the value in the position specified by the index number in the list.
remove_index() takes 2 parameters -- a list and an index number -- and remove the element at the position number indicated by index. It also prints the total number of elements in the list before and after removing the character in this fashion:"Total elements in list = 11
Total elements in list = 10"
reverse_list() takes 1 parameter -- a list -- and returns the list reversed.
Examples:
Example 1:
Enter values in list separated by commas: 1,2,4,63,6,4,22,53,76
[1, 2, 4, 63, 6, 4, 22, 53, 76]
Menu:
mutate list(m), remove (r), reverse_list (R)
Enter choice (m,r,R): m
4,45
[1, 2, 4, 63, 45, 6, 4, 22, 53, 76]
Example 2:
Enter values in list separated by commas: 1,2,4,6,84,3,2,2,76
[1, 2, 4, 6, 84, 3, 2, 2, 76]
Menu:
mutate list(m), remove (r), reverse_list (R)
Enter choice (m,r,R): R
[76, 2, 2, 3, 84, 6, 4, 2, 1]
Example 3:
Enter values in list separated by commas: 12,2,3,5,2,6,2,1,2,333,65
[12, 2, 3, 5, 2, 6, 2, 1, 2, 333, 65]
Menu:
mutate list(m), remove (r), reverse_list (R)
Enter choice (m,r,R): r
Example 4
Total elements in list = 11
Total elements in list = 10
[12, 2, 3, 5, 6, 2, 1, 2, 333, 65]
please use the codes below
def main():
user_list = input("Enter values in list separated by commas: ")
user_list = user_list.split(",")
user_list = [int(i) for i in user_list]
print(user_list)
print("Menu: ")
print("mutate list(m), remove (r), reverse_list (R)")
user_choice = input("Enter choice (m,r,R): ")
if user_choice == 'm':
index_num, v = input().split(",")
index_num = int(index_num)
v = int(v)
mutate_list(user_list, index_num, v)
print(user_list)
elif user_choice == 'r':
index_num = int(input())
remove_index(user_list, index_num)
print(user_list)
elif user_choice == 'R':
new_list = reverse_list(user_list)
print(new_list)
main()

Answers

Find the given attachments

Account Balance Design a hierarchy chart or flowchart for a program that calculates the current balance in a savings account. The program must ask the user for:________.
A- The starting balance
B- The total dollar amount of deposits made
C- The total dollar amount of withdrawals made
D- The monthly interest rate
Once the program calculates the current balance, it should be displayed on the screen.

Answers

Answer:

a. starting balance

Explanation:

A program that calculates the current balance of a savings should ask the user for the starting balance and then ask for the annual interest rate. A loop should then iterate once for every month of the savings period in order to perform other tasks such as asking the user for the total amount deposited into the account, the total amount withdrawn from the account, and calculate the interest rate. The program will then proceed to display the result at the end of the savings period.

Can you please at least give me some part of the code. At least how to start it in C++. Thank you!
Project 5: You will design and implement various classes and write a program to manage one of the following a bank, a hospital, a library, a business, an organization, etc.) The program must do the following:
1. Allow the initialization of the different attributes of the objects from the keyboard.
2. Allow the initialization of the different attributes from a file
3. Perform calculations on one (or more) of the attributes (e.g. calculateInterest, generateHospitalBill, calculateCheckedBooks, etc.)
4. Output a report of all objects created. The report called for by requirement 4 should output all information about each object. You will need to take advantage of the capabilities of C++ classes, inheritance and overriding.
Program Design:
1. Create at least one base class. All data members have to be private. Your main function and any function that it calls should use the member functions of this class for all transactions.
2. Create at least two derived class of the base class described in the previous point.
3. The program will maintain arrays of objects that interacts with each other to manage the designated establishment (bank, hospital, library, etc.). Please do not use anything more sophisticated than an array.
4. Keep the program simple. I am interested in whether you can demonstrate basic competence in the use of classes, inheritance, and good design.
5. All data members in the classes must be private. This is to assure that you use the C++ capabilities that this assignment is all about. Do not use any global variables.
6. When the user decides to quit the updated information is saved back to the secondary storage to give the user the option to either start fresh or continue where he/she left off at the beginning of the next execution

Answers

Answer:

Explanation:

The objective of this question is to  compute a program  that involve using  a  C++ code for  designing and implementing  a Bank Account Management Simulator with integrated file storage for saving details to secondary storage.

When writing this code I notice the words are more than 5000 maximum number of characters the text editor can contain, so i created a word document for it. The attached file  to the word document can be found below.

During an investigation of a cybercrime, the law enforcement officers came across a computer that had the hard drive encrypted. Chose the best course of action they should take to access the data on that drive.
a. Use image filtering techniques to see what's behing the encrypted files.
b. Try to convince the owner of the computer to give you to decryption key/password.
c. Identify the encryption algorithm and attempt a brute force attack to get access to the file.
d. Disconnect the hard drive from power so the encryption key can be exposed on the next power up.
e. Try to copy the drive bit by bit so you can see the files in each directory.

Answers

Answer:

b. Try to convince the owner of the computer to give you to decryption key/password.

Explanation:

Encrypted hard drives have maximum security and high data protection. to access them you need to enter a password to unlock them.

The image filtering technique is a method that serves to selectively highlight information contained in an image, for which it does not work.

The encryption algorithm is a component used for the security of electronic data transport, not to access data on an encrypted hard drive.

The encryption key is used in encryption algorithms to transform a message and cannot be exposed by disconnecting the hard drive from its power source.

Assume that you have a list of n home maintenance/repair tasks (numbered from 1 to n ) that must be done in numeric order on your house. You can either do each task i yourself at a positive cost (that includes your time and effort) of c[i] . Alternatively, you could hire a handyman who will do the next 4 tasks for the fixed cost h (regardless of how much time and effort those 4 tasks would cost you). The handyman always does 4 tasks and cannot be used if fewer than four tasks remain. Create a dynamic programming algorithm that finds a minimum cost way of completing the tasks. The inputs to the problem are h and the array of costs c[1],...,c[n] .

a) Find and justify a recurrence (without boundary conditions) giving the optimal cost for completing the tasks. Use M(j) for the minimum cost required to do the first j tasks.

b) Give an O(n) -time recursive algorithm with memoization for calculating the M(j) values.

c) Give an O(n) -time bottom-up algorithm for filling in the array.

d) Describe how to determine which tasks to do yourself, and which tasks to hire the handyman for in an optimal solution.

Answers

Answer:

Explanation:

(a) The recurrence relation for the given problem is :

T(n) = T(n-1) + T(n-4) + 1

(b) The O(n) time recursive algorithm with memoization for the above recurrence is given below :

Create a 1-d array 'memo' of size, n (1-based indexing) and initialize its elements with -1.

func : a recursive function that accepts the cost array and startingJobNo and returns the minimum cost for doing the jobs from startingJobNo to n.

Algorithm :

func(costArr[], startingJobNo){

if(startingJobNo>n)

then return 0

END if

if(memo[startingJobNo] != -1)

then return memo[startingJobNo];

END if

int ans1 = func(costArr, startingJobNo+1) + costArr[startingJobNo]

int ans2 = func(costArr, startingJobNo+4) + h

memo[startingJobNo] = min(ans1,ans2);

return memo[startingJobNo];

}

(c)

First, Create a 1-d array 'dp' of size, N+1.

dp[0] = 0

bottomUp(int c[]){

for  i=1 till i = n

DO

dp[i] = min(dp[i-1] + c[i], dp[max(0,i-4)] + h);

END FOR

return dp[n];

}

(d)

Modifying the algorithm given in part (b) as follows to know which job to do yourself and in which jobs we need to hire a handyman.

First, Create a 1-d array 'memo' of size, n (1-based indexing) and initialize its elements with -1.

Next, Create another 1-d array 'worker' of size,n (1-based indexing) and initialize its elements with character 'y' representing yourself.

Algorithm :

func(costArr[], startingJobNo){

if(startingJobNo>n)

then return 0

END if

if(memo[startingJobNo] != -1)

then return memo[startingJobNo];

END if

int ans1 = func(costArr, startingJobNo+1) + costArr[startingJobNo]

int ans2 = func(costArr, startingJobNo+4) + h

if(ans2 < ans1)

THEN

for (i = startingJobNo; i<startingJobNo+4 and i<=n; i++)

DO

// mark worker[i] with 'h' representing that we need to hire a mechanic for that job

worker[i] = 'h';

END for

END if

memo[startingJobNo] = min(ans1,ans2);

return memo[startingJobNo];

}

//the worker array will contain 'y' or 'h' representing whether the ith job is to be done 'yourself' or by 'hired man' respectively.

Write a program that displays the following pattern: ..\.\* .\.\*** \.\***** ******* \.\***** .\.\*** ..\.\* That is, seven lines of output as follows: The first consists of 3 spaces followed by a star. The second line consists of 2 spaces followed by a 3 stars. The third consists of one space followed by 5 stars, and the fourth consists just of 7 stars. The fifth line is identical to third, the sixth to the second and the seventh to the first. Your program class should be called StarPattern

Answers

Answer:

public class StarPattern {

   

   public static final int MAX_ROWS = 7;

   

    public static void main(String []args){

       

       for (int row = 1; row <= MAX_ROWS; row++) {

           int numOfSpaces = getNumberOfSpaces(row);

           int numOfStars = MAX_ROWS - (getNumberOfSpaces(row) * 2);

           String spaces = printSpaces(numOfSpaces);

           String stars = printStars(numOfStars);

           System.out.println(spaces + stars);

       }

       

    }

    public static int getNumberOfSpaces(int row) {

        int rowOffset = (MAX_ROWS / 2) + 1;

        return Math.abs(row-rowOffset);

    }

   

    public static String printSpaces(int num) {

        String result = "";

        for (int i = 0; i < num; i++) {

            result += " ";

        }

        return result;

    }

   

    public static String printStars(int num) {

        String result = "";

        for (int i = 0; i < num; i++) {

            result += "*";

        }

        return result;

    }

}

Explanation:

So it sounds we need to make a diamond shape out of asterisks like this:

  *

 ***

*****

*******

*****

 ***

  *

There are 7 rows and each row has up to 7 characters. The pattern is also symmetrical which makes it easier. Before writing any code, let's figure out how we are going to determine the correct amount of spaces we need to print. There are a lot of ways to do this, but I'll just show one. Let's call the 4th row y=0. Above that we have row 3 which would be y=-1, and below is row 5 which is y=1. With 7 rows, we have y=-3 through y=3. The absolute value of the y value is how many spaces we need.

To determine the number of stars, we just double the number of spaces, then subtract this number from 7. This is because we can imagine that the same amount of spaces that are printed in front of the stars are also after the stars. We don't actually have to print the second set of spaces since it is just white space, but the maximum number of characters in a row is 7, and this formula will always make sure we have 7.

I hope this helps. If you need help understanding any part of the code, jsut let me know.

#Write a function called "scramble" that accepts a string #as an argument and returns a new string. The new string #should start with the last half of the original string #and end with the first half. # #If the length of the string is odd, split the string #at the floor of the length / 2 (in other words, the second #half is the longer half). # #For example: # scramble("abcd") -> "cdab" # screamble("abcde") -> "cdeab" # scramble("railroad")) -> "roadrail" # scramble("fireworks")) -> "worksfire"

Answers

Answer:

def scramble(s):

   if len(s) % 2 == 1:

       index = int(len(s)//2)

   else:

       index = int(len(s)/2)

   

   return s[index:] + s[:index]

Explanation:

Create a function called scramble that takes one parameter, s

Check the length of the s using len function. If the length is odd, set the index as the floor of the length/2. Otherwise, set the index as length/2. Use index value to slice the s as two halves

Return the second half of the s and the second half of the s using slice notation (s[index:] represents the characters from half of the s to the end, s[:index] represents the characters from begining to the half of the s)

Chris wants to view a travel blog her friend just created. Which tool will she use?

HTML
Web browser
Text editor
Application software

Answers

Answer:

i think html

Explanation:

Answer:

Web browser

Explanation:

Other Questions
According to this account, what happened in the battle?A. The British soldiers panicked when they were shot at. B. The British soldiers drove the French and Indians off the hill. C. The French and Indians panicked when they were shot at. D. The French and Indians were surrounded by British forces. Triangle ABC was dilated using the rule DO,4. Triangle A'B'C' is the result of the dilation. Point O is the center of dilation. Triangle A B C is dilated to create triangle A prime B prime C prime. The length of O B is three-fourths. What is OB'? 1.5 units 3 units 4.5 units 6 units Organize the sentences to present a logical argument within a body paragraph Find the area of the figure in the picture please!!! For each pair of congruent triangles, name the corresponding parts then complete the congruence statement Solve the following equation for x.|x/4+3| It is common knowledge that actors are conceited because they have to be in order to be actors" is an example of what kind of fallacy? There are 6 brooms and 4 mops in a janitor's closet. What is the ratio of thenumber of brooms to the number of mops?O A.MIN0110OC.O D.nimSURA A quadrilateral-shaped land property is drawn on a coordinate grid. Two adjacent sides of the property lie along the lines y = 4x + 8 and y = 0.25x 9, with one corner of the property at the intersection point P of the lines. One of these sides ends at an oak tree located at (1, 4) and the other side ends at a pine tree located at (4,10).What are the coordinates of the point where the two lines intersect? Select the correct location on the image.Shelly evaluated this expression using the order of operations, but she made a mistake. Which step includes Shelly's mistake?2^2(3-8)divided by 5 - 1Step 1=2^2(-5)divided by 5-1Step 24(-5) divided by 5 - 1Step 3-20 divided by 5 -1Step 4= -20 divided by 4Step 5= -5 The index of refraction of Sophia's cornea is 1.387 and that of the aqueous fluid behind the cornea is 1.36. Light is incident from air onto her cornea at an angle of 17.5 from the normal to the surface. At what angle to the normal is the light traveling in the aqueous fluid? A bond with a 7-year duration is worth $1,079, and its yield to maturity is 7.9%. If the yield to maturity falls to 7.75%, you would predict that the new value of the bond will be approximately:_____________. what is the objectof the preposition among The concentration determined for an unknown sample of hydrochloric acid by a student is 0.1354 M.According to the instructors information, the true molarity (M) of this solution is 0.1364 M. What is the percent error in this experiment? Round your answer to the nearest tenth. Social Studies: Oil Vocabulary QuizQuestion 1: The year Spindletop oil well was discovered and Texas changed from an agriculturestate to an industrial state.a) 1900b) 1901c) 1910d) 1911 What number is the arrow point at? By law, the financial records of publicly held companies are required to be:________. A) Managed by an accounting department of at least five CPAs. B) Summarized in the employee manual for new hires. C) Reviewed quarterly by the IRS. D) Audited by a certified professional accounting firm. Qu hacen las personas para celebrar?Hay varias maneras diferentes en que las personas celebran el da, incluyendo desfiles, marchas y barbacoas. Muchas personas se renen para ceremonias que incluyen premios de servicio pblico, oracin y la izada de la bandera de Juneteenth. HELPPPPP PLZZZ2)Tom can paint a fence in 12 hours. Huck can paint the same fence in 10 hours. How long would it take to put two coats of paint on the fence if Tom and Huck work together? Answer as an improper fraction, then round to 1 decimal place.3)Kim and Josh can clean a house together in 3 hours. If it takes Kim 7 hours to clean the house by herself, how long would it take Josh to clean the house alone? Leave your answer in improper fraction form, then convert to a decimal.4)Jack can mow the baseball grounds in 2 hours; Mike can mow the same grounds in 3 hours; and Chris can mow the grounds in 4 hours. How long will it take to mow the baseball grounds if Jack, Mike, and Chris work together? Leave your answer in proper fraction form, then round to 1 decimal place. Using your rounded answer, how many minutes would that be? Hola. Mi nombre es Paula y yo vivo con dos de mis amigas. Trabajo en un restaurante. Mi mejor amiga es Eleodora y ellatrabaja en la oficina al lado del restaurante. Nosotras estudiamos en la universidad que est en esta ciudad. Marisol es miotra amiga y ella cuida enfermos en un hospitalCul es el nombre de la persona principal en esta historia?PaulaMarisolEleodoraPaulina