p25: File Write and Read1) User enters a file name (such as "myMovies.txt").2) User enters the titles of 4 of their favorite moveis (use a loop!).3) Program Writes the 4 titles to a file, one per line, then closes the file (use a loop!).4) Program Reads the 4 titles from "myMovies.txt" stores them in a list and shows the list5) The program writes the titles in reverse order into a file "reverseOrder.txt"Sample Run:Please enter a file name: myMovies.txtPlease enter a movie title #1: movie1Please enter a movie title #2: movie2Please enter a movie title #3: movie3Please enter a movie title #4: movie4Writing the 4 movie titles to file 'myMovies.txt'Reading the 4 movie titles from file into a list: [movie1, movie2, movie3, movie4]Writing the 4 movie titles in revers to 'reverseOrder.txt'Note: Do not use reverse() , reversed()Content of myMovies.txt:movie1movie2movie3movie4Content of reverseOrder.txtmovie4movie3movie2movie1

Answers

Answer 1

Answer:

The program goes as follows  

Comments are used to explain difficult lines

#include<iostream>

#include<fstream>

#include<sstream>

#include<string>

using namespace std;

int main()

{

//Declare String to accept file name

string nm;

//Prompt user for file name

cout<<"Enter File Name: ";

getline(cin,nm);

//Create File

ofstream Myfile(nm.c_str());

//Prompt user for 4 names of movies

string movie;

for(int i = 1;i<5;i++)

{

 cout<<"Please enter a movie title #"<<i<<": ";

 cin>>movie;

 //Write to file, the names of each movies

 Myfile<<movie<<endl;

}

Myfile.close(); // Close file

//Create an Array for four elements

string myArr[4];

//Prepare to read from file to array

ifstream file(nm.c_str());

//Open File

if(file.is_open())

{

 for(int i =0;i<4;i++)

 {

  //Read each line of the file to array (line by line)

  file>>myArr[i];

 }

}

file.close(); // Close file

//Create a reverseOrder.txt file

nm = "reverseOrder.txt";

//Prepare to read into file

ofstream Myfile2(nm.c_str());

for(int j = 3;j>=0;j--)

{

 //Read each line of the file to reverseOrder.txt (line by line)

 Myfile2<<myArr[j]<<endl;

}

Myfile2.close(); //Close File

return 0;

}

See attached for .cpp program file


Related Questions

Complete data are very rare because some data are usually missing. There are typically four strategies to handle missing data.
Ignore the variables with missing data.
Delete the records that have some missing values.
Impute the missing values (i.e., simply fill in the missing values with some other value, such as the mean of similar records with data).
Use a data mining technique that can handle missing values, such as CART, which is one of a few techniques that handle missing data pretty well.
Suppose you are working on a project to model a hotel company's customer base. The goal is to determine which customer attributes are correlated with a high number of hotel stays. You have access to data from a customer survey, but one field (which is optional) is yearly income and has some missing values equaling roughly 5% of the records. Which of the strategies should be used? Explain why. Suppose you chose the third strategy. Explain how you would impute the missing incomes.

Answers

Answer:

see explaination

Explanation:

If I am to select I will select the strategy Impute the missing values . Because rather than deleting and all the other strategies. This is the best option because, this is an optional field as described there is no need for such accurate information about salary.

If we want to maintain this field we can just fill the value by identifying the similar records which is the other customers who is visiting the same no of times and fill that.

Modify the selectionSort function presented in this chapter so it sorts an array of strings instead of an array of ints. Test the function with a driver program. Use program 8-8 as a skeleton to complete.

Program 8-8

#include

#include

using namespace std;

int main()

{

const int NUM_NAMES = 20

string names [NUM_NAMES] = {"Collins, Bill", "Smith, Bart", "Allen, Jim", "Griffin, Jim", "Stamey, Marty", "Rose,Geri", "Taylor, Terri", "Johnson, Jill", "Allison, Jeff", "Looney, Joe", "Wolfe, Bill", "James, Jean", "Weaver, Jim", "Pore, Bob", "Rutherford, Greg", "Javens, Renee", "Harrison, Rose", "Setzer, Cathy", "Pike, Gordon", "Holland, Beth" };

//Insert your code to complete this program

return 0;

}

Answers

Answer:

Following are the method to this question:

void selectionSort(string strArr[], int s) //defining selectionSort method

{

int i,ind; //defining integer variables

string val; //defining string variable

for (i= 0; i< (s-1);i++) //defining loop to count value

  {

      ind = i; //assign loop value in ind variable

      val = strArr[i]; // strore array value in string val variable

      for (int j = i+1;j< s;j++) // defining loop to compare value

      {

          if (strArr[j].compare(val) < 0) //using if block to check value

          {

              val = strArr[j]; //store value in val variable  

              ind= j; //change index value

          }

      }

      strArr[ind] = strArr[i]; //assign string value in strArray  

      strArr[i] = val; // assign array index value

  }

}

void print(string strArr[], int s) //defining print method

{

  for (int i=0;i<s;i++) //using loop to print array values

  {

      cout << strArr[i] << endl; //print values

  }

  cout << endl;

}

Explanation:

In the above-given code, two methods "selectionsort and print" is declared, in which, both method stores two variable in its parameter, which can be described as follows:

Insides the selectionSort method, two integer variable "i and ind" and a string variable "val" is defined, inside the method a loop is declared, that uses the if block condition to sort the array. In the next line, another method print is declared that declared the loop to prints its value. Please find the attachment for full code.

If many programs are kept in main memory, then there is almostalways another program ready to run on the CPU when a page faultoccurs. Thus, CPU utilization is kept high. If, however, we allocate alarge amount of physical memory to just a few of the programs, theneach program produces a smaller number of page faults. Thus, CPUutilization is kept high among the programs in memory. What would the working set algorithm try to accomplish, and why?(Hint: These two cases represent extremes that could lead toproblematic behavior.)

Answers

Answer:

With the analysis of the case, we can infer that regarding the model or algorithm of the work set, we want to reduce page faults in each individual process, guaranteeing that the set of pages are included before executing the process.

There are things that should not change, such as the set of pages used in the process or the working set as they are called, they could only change if a program moves to a different phase of execution. In this way the most suitable and profitable approach is proposed for the use of time in the processor, by avoiding bringing oagines from the hard disk and instead of this the process is executed, because otherwise it would take a long time what was observed in decreased performance.

Regarding what was mentioned in the question, it follows that 2 extremes lead to a problematic behavior, to define the first as a page fault and the second refers to a small number of processes executed.

As citizens online or in real life, how, or why, do the choices we make, almost always seems to have an effect (positive or negative) on others?

Answers

Answer:

The choices we make as citizens online or in real life have both positive and negative effects on others because we are social beings, who live in an interconnected world.  Every choice has some consequences on the decision maker or on others.  We make the choices, but the consequences follow natural laws, which we cannot control.  When Adam and Eve chose to disobey God, human beings down the ages lost their innocence and freedom.  When the Nazis chose to purify their race of European Jews, there was the Holocaust between 1941 and 1945.  When the Minneapolis police officer chose to slaughter George Floyd in cold blood, violent protests erupted throughout the U.S.

Another current example to buttress this is the ravaging coronavirus pandemic, which originated in Wuhan - China.  When the Chinese Communist  government chose to suppress the information about the virus as it usually does, the aftermath is the thousands of dead humans all over the world, the economic downturn, loss of jobs, virus infections with other public health side effects, plus many other untold consequences.

Had the Chinese government made a different choice, the virus could not have spread worldwide as it had.  Similarly, some citizens online choose to circulate unverifiable ("fake news") information.  Many people have been misled by their antics, some have lost their lives, while many others live in perpetual bigotry and hatred.  All these are because of individual choices.

Explanation:

Choice is a concept in decision making.  It is the judging of the merits of multiple options so that one or some of the options are selected.  When a voter votes for one candidate against others, she has made a choice (decision).  Of course, choices have consequences, which we must live with.  Choices also define our present and our future.

what is the basic similarities and difference between the three project life cycles model? ​

Answers

Answer:

Project life cycle is the time taken to complete a project, from start to finish.

The three project life cycles model include the following:

PredictiveIterative and IncrementalAdaptive

Explanation:

Predictive project life cycles model: In this stage, the three major constraints of the project which are the scope, time and cost are analyzed ahead of time and this analysis is well detailed and the detailed scope of the project is done right from the start of the project.

Iterative and Incremental life cycles model: In this iterative and incremental model, the project is again split into stages that can be sequential or overlapping and at the first iteration of the project, the scope is determined ahead of time.

Adaptive life cycles model: Also in this stage, the project is split up into phases but because these phases are more rapid and ever changing unlike the other models, the processes within the scope can work in parallel.

Similarities

They make use of high level planning.They are sequential and overlapping.They make use of high level scope.

Differences

The predictive life cycle model makes use of a detailed scope at the beginning of a project while the other models make use of detailed scope only for each phase.In predictive life cycle model, the product is well understood, in other models, the projects are complex and not easily understood.There is periodic customer involvement in predictive and interative life cycle model while the customer involvement in the adaptive model, the customer model is continuous.

Answer:

similarities :  They all are brought in to the world somehow.

They all have difreant stages to become an adult.

Difreances: They have difreant number of stages till they become an adult.

they all have difreant lypes of growing their bodies do.

Explanation:

Write a method that sums all the numbers in the major diagonal in an n x n matrix of double values using the following header: public static double sumMajorDiagonal(double[][] m) Write a test program that first prompts the user to enter the dimension n of an n x n matrix, then asks them to enter the matrix row by row (with the elements separated by spaces). The program should then print out the sum of the major diagonal of the matrix.

Answers

Answer:

Following are the code to this question:

import java.util.*; //import package for user input

public class Main //defining main class

{

public static double sumMajorDiagonal(double [][] m) //defining method sumMajorDiagonal

{

double sum = 0; //defining double variable sum

int i, j; //defining integer variable  

for(i = 0; i <m.length; i++) //defining loop to count row

{

for(j = 0; j < m.length; j++) //defining loop to count column  

{

if(i == j) //defining condition to value of i is equal to j

{

sum=sum+ m[i][j]; //add diagonal value in sum variable

}

}

}

return sum; //return sum

}

public static void main(String args[]) //defining main method

{

int n,i,j; //defining integer variable    

System.out.print("Enter the dimension value: "); //print message

Scanner ox = new Scanner(System.in); //creating Scanner class object for user input

n = Integer.parseInt(ox.nextLine()); //input value and convert value into integer

double m[][] = new double[n][n]; //defining 2D array

for(i = 0; i < m.length; i++)

{

String t = ox.nextLine(); // providing space value

String a[] = t.split(" "); // split value

for(j = 0; j < a.length; j++) //defining loop to count array value

{

double val = Double.parseDouble(a[j]); //store value in val variable

m[i][j] = val; //assign val in to array

}

}

double d_sum = sumMajorDiagonal(m); //call method store its return value in d_sum variable

System.out.println("diagonal matrix sum: "+ d_sum); //print sum

}

}

output:

Enter the dimension value: 3

1 2 3

1 2 3

1 2 4

diagonal matrix sum: 7.0

Explanation:

Program description:

In the given java language code, a method "sumMajorDiagonal" is declared, that accepts a double array "m" in its parameter, inside the method two integer variable "i and j" and one double variable "sum" is defined, in which variable i and j are used in a loop to count array value, and a condition is defined that checks its diagonal value and use sum variable to add its value and return its value. In the main method first, we create the scanner class object, that takes array elements value and passes into the method, then we declared a double variable d_sum that calls the above static method, that is  "sumMajorDiagonal" and print its return value with the message.

Highlights the possible risks and problems that should be addressed during the implementation process

Answers

Answer:

The answer is below

Explanation:

Since the type of Implementation is not stated specifically, it is believed that, the question is talking about ERP Implementation, because it is related to subject in which the question is asked.

Hence, Enterprise Resource Planning (ERP) implementation deals basically, by carrying out installation of the software, transferring of finanancial data over to the new system, configuring application users and processes, and training users on the software

ERP Implementation Risks involve the following:

1. Inefficient Management and Project Activities.

2. Inadequate or No Training and Retraining of Customers or End-Users.

3. Inability to Redesign Business Processes to meet the Software requirements.

3. Incompetent or lack of Technical Support Team and Infrastructure.

4. Incapability to Obtain Full-Time Commitment of Employee.

5. Failure to Recruit and Maintained Qualified Systems, and Developers.

Research and a well-written problem statement are important because

ANSWER: A) they give a clear understanding of the problem and its solution

Answers

Answer:

they give a clear understanding of the problem and its solution

Answer:

The answer is in the question,A

Explanation:

They give a clear understanding of the problem and its solution

Only one calendar can be visible at a time
in Outlook.
Select one:
a. False
b. True

Answers

Answer:

a. False

Explanation:

It is false as more than one calendar is visible in outlook.

Explanation:

it is false

i think it helps you

Which of the following groups is NOT located on the Home tab?

Answers

Which of the following groups is NOT located on the Home tab?

Animations

Animations is not located

What must be done to translate a posttest loop expressed in the form


repeat:


(. . . )


until (. . . )


into an equivalent posttest loop expressed in the form


do:


(. . . )


while (. . . )

Answers

Answer:

num = 0

while (num < 50):

if (num is Odd)

print(num is Odd)

num = num + 1

num = 0

repeat:

if (num is Odd)

print(num is Odd)

num = num + 1

until (num>=50)

A basketball game has four quarters. Write a program to do the following. Use a for loop to input scores of team A and team B in each of the four quarters. Every time a score is entered, update and display the current total score of that team. After all four quarters, compare the total scores of the two teams and display the outcome of the game (“Team A has won”, “Team B has won” or “It is a tie”)

Enter team A score in this quarter: 22
Team A score so far: 22
Enter team B score in this quarter: 24
Team B score so far: 24
Enter team A score in this quarter: 19
Team A score so far: 41
Enter team B score in this quarter: 26
Team B score so far: 50
Enter team A score in this quarter: 25
Team A score so far: 66
Enter team B score in this quarter: 22
Team B score so far: 72
Enter team A score in this quarter: 21
Team A score so far: 87
Enter team B score in this quarter: 20
Team B score so far: 92
Team B has won

Enter team A score in this quarter: 22
Team A score so far: 22
Enter team B score in this quarter: 20
Team B score so far: 20
Enter team A score in this quarter: 26
Team A score so far: 48
Enter team B score in this quarter: 21
Team B score so far: 41
Enter team A score in this quarter: 19
Team A score so far: 67
Enter team B score in this quarter: 28
Team B score so far: 69
Enter team A score in this quarter: 25
Team A score so far: 92
Enter team B score in this quarter: 23
Team B score so far: 92
It is a tie


Answers

Answer:

The program in cpp for the given scenario is shown.

#include <iostream>

using namespace std;

int main()

{

   //variables declared to hold individual and total scores

   int score_a=0, a;

   int score_b=0, b;

   //user input taken for score

   for(int i=0; i<4; i++)

   {

       std::cout << "Enter team A score in quarter " <<(i+1)<<" : ";

       cin>>a;

       score_a = score_a+a;

       std::cout << "Team A score so far: "<< score_a <<std::endl;

       std::cout << "Enter team B score in quarter " <<(i+1)<<" : ";

       cin>>b;

       score_b = score_b+b;

       std::cout << "Team B score so far: "<< score_b <<std::endl;

   }

   //winner team decided by comparing scores

   if(score_a>score_b)

       std::cout << "Team A has won" << std::endl;

   if(score_a==score_b)

       std::cout << "It is a tie." << std::endl;

   if(score_a<score_b)

       std::cout << "Team B has won" << std::endl;

   //program ends

   return 0;

}

Explanation:

1. The integer variables are declared to hold both individual scores and the total score for both the teams.

   int score_a=0, a;

   int score_b=0, b;

2. The variables to hold total scores are initialized to 0.

3. Inside for loop, scores for both teams for all 4 quarters are taken from the user.

4. Inside the same for loop, a running total for the score of each team is computed and displayed.

score_a = score_a+a;

score_b = score_b+b;

5. Outside the loop, the total scores of both the teams are compared and the winner team is displayed. This is done using multiple if statements.

if(score_a>score_b)

       std::cout << "Team A has won" << std::endl;

   if(score_a==score_b)

       std::cout << "It is a tie." << std::endl;

   if(score_a<score_b)

       std::cout << "Team B has won" << std::endl;

6. After each message is displayed, a new line is inserted at the end using keyword, endl.

7. The program ends with a return statement.

8. The whole code is written inside main(). In cpp, it is not mandatory to write the code inside a class since cpp is not a purely object-oriented language.

9. The output is attached in an image.

Write a script that declares and sets a variable that’s equal to the total outstanding balance due. If that balance due is greater than $10,000.00, the script should return a result set consisting of VendorName, InvoiceNumber, InvoiceDueDate, and Balance for each invoice with a balance due, sorted with the oldest due date first. If the total outstanding balance due is less than $10,000.00, return the message "Balance due is less than $10,000.00."

Answers

Answer:

see explaination

Explanation:

SCRIPT :

drop table Vendor;

create table Vendor (VendorName varchar2(20), InvoiceNumber number (20), InvoiceDueDate date, Balance number(32,6));

insert into VENDOR (VENDORNAME,INVOICENUMBER,INVOICEDUEDATE,BALANCE) values ('ABC',121,TO_TIMESTAMP('01-01-18','DD-MM-RR HH12:MI:SSXFF AM'),1000);

Insert into Vendor (VENDORNAME,INVOICENUMBER,INVOICEDUEDATE,BALANCE) values ('XYZ',1212121,to_timestamp('02-01-18','DD-MM-RR HH12:MI:SSXFF AM'),100000);

declare

cursor c1 is select * from Vendor;

begin

for i in c1

loop

if I.BALANCE < 1001 then

DBMS_OUTPUT.PUT_LINE('Vendor Name '||I.VENDORNAME||', Invoice Number '||I.INVOICENUMBER||', Invoice DueDate '||I.INVOICEDUEDATE||',BALANCE '||I. BALANCE);

else

dbms_output.put_line('Vendor Name '||i.VendorName||', Invoice Number '||i.InvoiceNumber||', Invoice DueDate '|| i.InvoiceDueDate||' Balance due is less than $1000');

end if;

end LOOP;

end;

output : SCRIPT OUTPUT

table VENDOR dropped.

table VENDOR created.

1 rows inserted.

1 rows inserted.

anonymous block completed

dbms output :

Vendor Name ABC, Invoice Number 121, Invoice DueDate 01-JAN-18,BALANCE 1000

Vendor Name XYZ, Invoice Number 1212121, Invoice DueDate 02-JAN-18 Balance due is less than $1000

One factor in algorithm performance that we've not had a chance to speak much about this quarter, but one that is certainly relevant in practice, is parallelism, which refers to the ability to speed up an algorithm by doing more than one thing at once. Nowadays, with most personal laptop or desktop computers having multicore processors, and with many workloads running on cloud infrastructure (i.e., potentially large numbers of separate machines connected via networks), the ability to run an algorithm in parallel is more important than ever.

Of course, not all problems can be parallelized to the same degree. Broadly, problems lie on a spectrum between two extremes. (In truth, most problems lie somewhere between these extremes, but the best way to understand what's possible is to know what the extremes are.)

Embarrassingly parallel problems are those that are composed primarily of independent steps that can be run in isolation from others and without respect to the results of the others, which makes them very easy to parallelize. Given n cores or machines, you could expect to run n steps simultaneously without any trouble.
Inherently serial problems are those whose steps have to be run sequentially, because the output of the first step makes up part of the input to the second step, and so on. Multiple cores or machines aren't much help for problems like this.
Now consider all of the sorting algorithms we learned about in our conversation about Comparison-Based Sorting. For which of the algorithms would you expect a multicore processor to be able to solve the problem significantly faster than a single-core processor would be able to solve it? For each of the ones that would benefit, briefly explain, in a sentence or two, why multiple cores would be beneficial. (There's no need to do any heavy-duty analysis here; we just want to see if you've got a sense of which might benefit from parallelism and why.)

Answers

Answer:

Quick sort and Merge sort supports parallelism

Explanation:

When we talk about parallelism, we are referring to the idea of breaking down a problem into a number of many subproblems after which we combine the solutions of these subproblems into a single solution. Here we allocate these subtasks to the multicore processors where each core gets assigned each of the subtasks are assigned to a core according to its ability or functionality. After each of the core are through with its evaluation, all their results are collated and combined to come up with a full rounded and complete solution to the given problem.

If we take a look at sorting algorithms such as selection sort, bubble sort and insertion sort, we will find out that these algorithms cant be simulated on a multicore processor efficiently because they are sequential algorithms.

On the other hand, we have sorting algorithms that can easily be simulated in a multicore processor since they can divide the given problem into subproblems to solve after which the solutions can be combined together to arrive at or come up with a complete solution to the problem. This algorithms includes Quick sort and Merge sort, they make use of Divide and Conquer paradigm.

Days of Each Month Design a program that displays the number of days in each month. The program’s output should be similar to this: January has 31 days. February has 28 days. March has 31 days. April has 30 days. May has 31 days. June has 30 days. July has 31 days. August has 31 days. September has 30 days. October has 31 days. November has 30 days. December has 31 days. Psuedocode

Answers

Answer:

A python script:

months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]

numbers = [31,28,31,30,31,30,31,31,30,31,30,31]

counter = 0

numbers_length=len(numbers)-1

while counter <= numbers_length:

month=months[counter]

number=numbers[counter]

print (month + " has " + str(number) + " days")

counter = counter+1

Explanation:

The Python script above will generate this output:

January has 31 days.

February has 28 days.

March has 31 days.

April has 30 days.

May has 31 days.

June has 30 days.

July has 31 days.

August has 31 days.

September has 30 days.

October has 31 days.

November has 30 days.

December has 31 days.

Write a function with this prototype:
#include
void numbers(ostream& outs, const string& prefix, unsigned int levels);
The function prints output to the ostream outs. The output consists of the String prefix followed by "section numbers" of the form 1.1., 1.2., 1.3., and so on. The levels argument determines how many levels the section numbers have. For example, if levels is 2, then the section numbers have the form x.y. If levels is 3, then section numbers have the form x.y.z. The digits permitted in each level are always '1' through '9'. As an example, if prefix is the string "THERBLIG" and levels is 2, then the function would start by printing:
THERBLIG1.1.THERBLIG1.2.THERBLIG1.3.and ends by printing:THERBLIG9.7.THERBLIG9.8.THERBLIG9.9.The stopping case occurs when levels reaches zero (in which case the prefix is printed once by itself followed by nothing else).The string class from has many manipulation functions, but you'll need only the ability to make a new string which consists of prefix followed by another character (such as '1') and a period ('.'). If s is the string that you want to create and c is the digit character (such as '1'), then the following statement will correctly form s:s = (prefix + c) + '.';This new string s can be passed as a parameter to recursive calls of the function.

Answers

Answer:

Following are the code to this question:

#include <iostream> //defining header file  

using namespace std;

void numbers(ostream &outs, const string& prefix, unsigned int levels); // method declaration

void numbers(ostream &outs, const string& prefix, unsigned int levels) //defining method number

{

string s; //defining string variable

if(levels == 0) //defining condition statement that check levels value is equal to 0

{

outs << prefix << endl;  //use value

}

else //define else part

{

for(char c = '1'; c <= '9'; c++) //define loop that calls numbers method

{

s = prefix + c + '.'; // holding value in s variable  

numbers(outs, s, levels-1); //call method numbers

}

}

}

int main() //defining main method

{

numbers(cout, "THERBLIG", 2); //call method numbers method that accepts value

return 0;

}

Output:

please find the attachment.

Explanation:

Program description:

In the given program, a method number is declared, that accepts three arguments in its parameter that are "outs, prefix, levels", and all the variable uses the address operator to hold its value. Inside the method a conditional statement is used in which string variable s and a conditional statement is used, in if the block it checks level variable value is equal to 0. if it is false it will go to else block that uses the loop to call method. In the main method we call the number method and pass the value in its parameter.  

what is the percentage of 20?

Answers

Hi!

I'm Happy to help you today!

The answer to this would be 20%!

The reason why is because percents are simple to make! Like theres always an end percent! But its always gonna end at 100% Let me show you some examples to help you understand!

So were gonna have the end percent at 100%

Lets turn 2 into a percent!

2 = 2% because its under 100%

Now lets go into a Higher number like 1000%

So lets turn 33 into a percent!

33 = 3.3% 30 turns into 3% because of the max percent of 1000% and then 3 turns into .3% because of the max of 1000%

I hope this helps!

-LimitedLegxnd

-If you enjoyed my answer make sure to hit that Heart! Also Rate me to show others how well i did! You can do that by clicking the stars!

-Question asker mark me brainliest if you really enjoyed my answer!

What are examples of common computer software problems? Check all that apply
Pages with fading ink come out of a printer.
Programs suddenly quit or stop working.
O Documents close without warning.
O A video file stops playing unexpectedly.
A program updates to the latest version.
A computer crashes and stops working.

Answers

Answer:

its A C E

Explanation:

Write the method scrambleWord, which takes a given word and returns a string that contains a scrambled version of the word according to the following rules.
a. The scrambling process begins at the first letter of the word and continues from left to right.
b. If two consecutive letters consist of an "A" followed by a letter that is not an "A", then the two letters are swapped in the resulting string.
c. Once the letters in two adjacent positions have been swapped, neither of those two positions can be involved in a future swap.
The following table shows several examples of words and their scrambled versions.
word Result returned by scrambleWord(word)
"TAN" "TNA"
"ABRACADABRA" "BARCADABARA"
"WHOA" "WHOA"
"AARDVARK" "ARADVRAK"
"EGGS" "EGGS"
"A" "A"
"" ""

Answers

Answer:

Let's implement the program using JAVA code.

import java.util.*;

import java.util.ArrayList;

import java.io.*;

public class ScrambledStrings

{

/** Scrambles a given word.

* atparam word the word to be scrambled

* atreturn the scrambled word (possibly equal to word)

* Precondition: word is either an empty string or contains only uppercase letters.

* Postcondition: the string returned was created from word as follows:

* - the word was scrambled, beginning at the first letter and continuing from left to right

* - two consecutive letters consisting of "A" followed by a letter that was not "A" were swapped

* - letters were swapped at most once

*/

public static String scrambleWord(String word)

{

// iterating through each character

for(int i=0;i<word.length()-1;)

{

//if the condition matches

if(word.charAt(i)=='A' && word.charAt(i+1)!='A'){

//swapping the characters

word=word.substring(0,i)+word.charAt(i+1)+word.charAt(i)+word.substring(i+2);

//skipping the letter

i+=1;

}

//skipping the letter

i+=1;

}

return word;

}

Explanation:

Note: Please replace the "at" on the third and fourth line with at symbol that is shift 2.

Why is it difficult to convince top management to commit funds to develop and implement a Strategic Information System

Answers

Answer:

It is difficult to convince top management to commit funds to develop and implement an SIS because it can lead to reengineering, which requires businesses to revamp processes to undergo organizational change to gain an advantage.

Explanation:

Write a Java code for the following requirement.
File encryption is the science of writing the contents of a file in a secret code.
The encryption program should work like a filter, reading the contents of one file, modifying the data into code, and then writing the code contents out to a second file. The second file will be a version of the first file, but written in a secret code.
Although there are complex encryption techniques, you should come up with a simple one of your own. For example, you could read the first file one character at a time and add 10 to the character code of each character before it is written to the second file.

Answers

Answer:

import java.io.File;

import java.io.FileInputStream;

import java.io.FileNotFoundException;

import java.io.FileOutputStream;

import java.io.IOException;

import java.util.Scanner;

public class EncryptFileData

{

public static void main(String args[]) throws IOException, FileNotFoundException

{

String inputFileName="input.txt";

String outputFileName="EncryptedFile.txt";

String decryptFileName="DecryptedFile.txt";

byte codeValue;

Scanner sc=new Scanner(System.in);

//Accept code value from user

System.out.println("Enter the value of code");

codeValue=sc.nextByte();

//Encrypt the input file

encryptFileContent(inputFileName, codeValue,outputFileName);

//Decrypt the input file

decryptFileContent(outputFileName, codeValue,decryptFileName);

}

//function to encrypt the input file

private static void encryptFileContent(String inputFileName,

byte encodeValue, String outputFileName) throws IOException, FileNotFoundException{

File file = new File(inputFileName);

FileInputStream fin = new FileInputStream(file);

FileOutputStream fout = new FileOutputStream(outputFileName);

try{

while(fin.available() != 0){

int inData = fin.read();

//For every character in input add code value and

//write result to file "EncryptedFile.txt"

fout.write(inData+encodeValue);

}

}finally{

fin.close();

fout.close();

}

}

//function to decrypt the encrypted file

private static void decryptFileContent(String inputFileName,

byte encodeValue, String outputFileName) throws IOException, FileNotFoundException{

File file = new File(inputFileName);

FileInputStream fin = new FileInputStream(file);

FileOutputStream fout = new FileOutputStream(outputFileName);

try{

while(fin.available() != 0){

int inData = fin.read();

//For every character in encrypted file

//subtract the code value from each character and

//write it to file "DecryptedFile.txt"

fout.write(inData-encodeValue);

}

}finally{

fin.close();

fout.close();

}

}

}

Explanation:

Given the following conditions to follow in the question;

=> "The encryption program should work like a filter, reading the contents of one file, modifying the data into code, and then writing the code contents out to a second file. "

=> "The second file will be a version of the first file, but written in a secret code."

Thus, the Java code is given below(one can just copy and run it to give a sample output of: Enter the value of code 1 2.

The Java code is;

import java.io.File;

import java.io.FileInputStream;

import java.io.FileNotFoundException;

import java.io.FileOutputStream;

import java.io.IOException;

import java.util.Scanner;

public class EncryptFileData

{

public static void main(String args[]) throws IOException, FileNotFoundException

{

String inputFileName="input.txt";

String outputFileName="EncryptedFile.txt";

String decryptFileName="DecryptedFile.txt";

byte codeValue;

Scanner sc=new Scanner(System.in);

//Accept code value from user

System.out.println("Enter the value of code");

codeValue=sc.nextByte();

//Encrypt the input file

encryptFileContent(inputFileName, codeValue,outputFileName);

//Decrypt the input file

decryptFileContent(outputFileName, codeValue,decryptFileName);

}

//function to encrypt the input file

private static void encryptFileContent(String inputFileName,

byte encodeValue, String outputFileName) throws IOException, FileNotFoundException{

File file = new File(inputFileName);

FileInputStream fin = new FileInputStream(file);

FileOutputStream fout = new FileOutputStream(outputFileName);

try{

while(fin.available() != 0){

int inData = fin.read();

//For every character in input add code value and

//write result to file "EncryptedFile.txt"

fout.write(inData+encodeValue);

}

}finally{

fin.close();

fout.close();

}

}

//function to decrypt the encrypted file

private static void decryptFileContent(String inputFileName,

byte encodeValue, String outputFileName) throws IOException, FileNotFoundException{

File file = new File(inputFileName);

FileInputStream fin = new FileInputStream(file);

FileOutputStream fout = new FileOutputStream(outputFileName);

try{

while(fin.available() != 0){

int inData = fin.read();

//For every character in encrypted file

//subtract the code value from each character and

//write it to file "DecryptedFile.txt"

fout.write(inData-encodeValue);

}

}finally{

fin.close();

fout.close();

}

}

}


The data structure used for file directory is called
Select one
a. process table
b. mount table
C. hash table
d file table​

Answers

This is a tough question. I’m not sure if I’ll get it right but I’ll try.

Data structures used for file directories typically have a hierarchical tree structure, referred to as a directory structure. The tree has a root directory, and every file in that system has a unique path.

The simplest method of implementing a directory is to use a linear list of file names with pointers to the data blocks. But another way that you can format a file directory is by using a hash table. With this method, the linear list stores the directory entries, but a hash data structure is also used. The hash table takes a value computed from the file name and return the pointer to the file name any linear list.

So I think it’s C. But I’m not 100% sure.

I hope that helps.

We have three containers whose sizes are 10 pints, 7 pints, and 4 pints, respectively. The 7-pint and 4-pint containers start out full of water, but the 10-pint container is initially empty. We are allowed one type of operation: pouring the contents of one container into another, stopping only when the source container is empty or the destination container is full. We want to know if there is a sequence of pourings that leaves exactly 2 pints in the 7-pint or 4-pint container.
(a) Model this as a graph problem: give a precise definition of the graph involved and state the specific question about this graph that needs to be answered.
(b) What algorithm should be applied to solve the problem?
(c) Find the answer by applying the algorithm.

Answers

Answer:

well, idc

Explanation:

Write a code for the following requirement.
The program must prompt for a name, and then tell the user how many letters are in the name, what the first letter of the name is, and what the last letter of the name is. It should then end with a goodbye message. A sample transcript of what your program should do is below - user input is in bold:
Enter your name: Jeremy
Hello Jeremy!
Your name is 6 letters long.
Your name starts with a J.
Your name ends with a y.
Goodbye!

Answers

Answer:

// This program is written in C++

// Comments are used for explanatory purposes

// Program starts here

#include<iostream>

using namespace std;

int main()

{

// Declare Variable name

string name;

// Prompt user for input

cout<<"Enter your name: ";

cin>>name;

// Print name

cout<<"Hello, "<<name<<"!\n";

// Print length of name

cout<<"Your name is "<<name.length()<<" letters long\n";

// Print first character

cout<<"Your name starts with a "<<name.at(0)<<"\n";

// Print last character

cout<<"Your name end with a "<<name.at(name.length()-1)<<"\n";

cout<<"Goodbye!";

return 0;

}

2 point) Express this problem formally with input and output conditions.2.(2 points) Describe a simple algorithm to compute the upper median. How manyoperations does it take asymptotically in the worst case?3.(7 points) Show how you can use the (upper) medians of the two lists to reduce thisproblem to its subproblems. State a precise self-reduction for your problem.4. (7 points) State a recursive algorithm that solves the problem based on your reduction.5.(2 point) State a tight asymptotic bound on the number of operations used by youralgorithm in the worst case.

Answers

Answer:

See attached images

A Transmission Control Protocol (TCP) connection is in working order and both sides can send each other data. What is the TCP socket state?

Answers

Answer:

The TCP socket state will be as 'Closed'.

Explanation:

TCP seems to be a framework that describes how well a web discussion can be established and maintained through which software applications could access information.

The accompanying is the finished status whenever the connection is suspended by TCP:

CLOSE-WAIT:

This means that the end destination had already chosen to take a similar requirement from the 'remote endpoint.'

CLOSING:

This indicates the position for the cancellation of server access verification from either the faraway TCP.

LAS-ACK:

This indicates the view for approval including its extermination previously sent through the cell tower TCP.

TIME-WAIT:

This symbolizes a lengthy delay for all the remote to accept verification of its cancellation request.

CLOSED:

This means that there is no link region or anything like that.

A company wants to implement a wireless network with the following requirements:
i. All wireless users will have a unique credential.
ii. User certificate will not be required for authentication
iii. The company's AAA infrastructure must be utilized
iv. Local hosts should not store authentication tokesn
1. Which of the following should be used in the design to meet the requirements?
O EAP-TLS
O WPS
O PSK
O PEAP

Answers

Answer:

PEAP is the correct answer to the given question .

Explanation:

The  PEAP are implemented to meet the demands because it is very much identical to the EAP-TTLS design also it includes the server-side PKI authentication .

The main objective of  PEAP is to establish the protected TLS tunnel for protecting the authentication process, as well as a server-side encryption authentication.The PEAP  is also used for validating the application it validating her process with the help of the TLS Tunnel encryption between the user and the verification.All the other options are not suitable for the  to meet the requirements of the design that's why these are incorrect option .

Write short notes on a. Transaction Processing System (TPS)

Answers

Answer: A Transaction Processing System (TPS) is a type of information system that collects, stores, modifies and retrieves the data transactions of an enterprise. Rather than allowing the user to run arbitrary programs as time-sharing, transaction processing allows only predefined, structured transactions.

Three cycles: Transaction processing systems generally go through a five-stage cycle of 1) Data entry activities 2) Transaction processing activities 3) File and database processing 4) Document and report generation 5) Inquiry processing activities.

Explanation: hope this helps!

It’s pretty much impossible to have a bug-free game upon initial release for anything but the simplest game.
True
False

Answers

Answer:

True

Explanation:

There are usually thousands of line of code and the programmers have to account for serveral different things. For that reason, most complex games will have at least some bugs.

You are responsible for managing Windows updates on 80 Windows 10 Enterprise computers at the office. You currently receive alert notifications when a new critical or security update is available for approval. Once you approve the updates, they are eventually installed. You would like these updates to apply automatically for the Windows 10 computers, and ensure that they are applied within 1 day of approval. How can this be accomplished with Intune

Answers

Answer:

Intune is a software that helps windows patching and upgrades. once the computer is connected to the internet/network. Intune will download updates to a particular computer that is targeted.

Explanation:

Solution

Intune is software that provides windows patching by discovering the PC’s connected to the network, pushing latest upgrades to the PC’s and detecting their current patch level.

Intune will make the updates download in the PC targeted when the PC’s are connected to the internet. Once they are downloaded it will wait until the PC gets restarted. If not it will give a popup that updates needs to be downloaded and will provide a timeline like two hours after which the PC by itself will auto restart.

All these can automatically be managed or done by the software. only it is required to be configured in a way that the PC’s should will be updated within 1 day, and Intune will use its algorithm to calculate the restart time and do the rest work on it's own.

Other Questions
Triangle ABC is transformed to create triangle MNL. 2 triangles have identical side lengths and measures. The second triangle is shifted down and slightly to the right. Which statement is true? The transformation is rigid because corresponding side lengths and angles are congruent. The transformation is rigid because corresponding side lengths are congruent and corresponding angles are not congruent. The transformation is nonrigid because the two triangles have different names. The transformation is nonrigid because the three sides and the three angles in each triangle have different measures. The probability of an event is 3:5. What is this probability expressed as a decimal ? Writers should check to make sure their homophones are used accurately because homophones are easily confused due totheir similarAbcsoundshistoriesmeaningssource languages Find the quotient: 8,441 21 = ________. a. 400 r 12 b. 400 r 20 c. 401 r 12 d. 400 r 20 what is this answer plz The ELA question is attached belowPlease someone do this for me it will really mean alotalso answer it right What is the disadvantage of server based network? How does the tiny acorn grow into a gigantic tree? Where does all that matter come from? scientific explanation please! What did the author mean by "dam of lies" in this quote: "Once the dam of lies cracked, it quickly collapsed under the increasing flow of revelations that would eventually drown the presidency." angaroo inc is a U.S. company whose shares are listed on and freely traded on the New York stock exchange. Let ???????? be the price of Kangaroo inc shares in dollars, at time ???? (measured in years). Time zero is today.You are (still) the Global Head of Equity Options trading at Goldman Sachs. You are approached by a hedge fund that today wants to buy a security (called a SQUARED DIFFERENCE contract) that has the following features:The SQUARED DIFFERENCE security has a maturity of one year.At maturity, the SQUARED DIFFERENCE security pays an amount in dollars equal to the amount(????????)????????(????????)???? (????????)????Here, ???????? and ???????? are, respectively, the Kangaroo inc share price one year from now and the share price today.Assume that the risk-free interest rate is zero per cent and that Kangaroo inc shares pay no dividends. Assume that the share price, in dollars, today is ???????? = 1.Using Excel, build a four-step binomial tree (this means each time step corresponds to three months). (Hint: It is the same idea as we did in classes and assignments but whereas, before, we had one, two or three steps, now you will have four binomial steps).Assume the absence of arbitrage throughout and assume that there are no transactions costs.a) Assume (to begin with) that the volatility of Kangaroo inc shares is ????????. Using your binomial tree, what is the price today of this SQUARED DIFFERENCE security? (???? marks)b) Still assuming the volatility of Kangaroo inc shares is ????????, and using the binomial tree, what is the delta hedge at each step. To answer this, do a screen-shot (Control-C then Control V on a pc) of the delta hedges. Do you see a pattern in the delta hedges? What is it? (???? marks)c) Now assume instead that the volatility of Kangaroo inc shares is ????????. What is the price today of this SQUARED DIFFERENCE security? (???? mark)d) Now assume instead that the volatility of Kangaroo inc shares is ????????, then ????????, then ????????, then finally ???????????? (skip ????, ????, ???? and ???????? - you will (hopefully) already see a pattern emerging).For each case, what is the price today of this SQUARED DIFFERENCE security? (Hint: If you do this in excel in an efficient manner, this can be done very rapidly). (???? marks)Give your answers to parts (a), (c) and (d) (in dollars) by filling out the table below (replacing x.yyyyyyy) giving every answer to ???? decimal places (you will see that the answers are quite small so that is why I am asking for ???? decimal places but this is no hassle - decimal places are "free" in excel since excel allows you to format up to ???????? decimal places Google this formatting feature if you have not seen it before):e) What is the pattern of prices? (A graph might be helpful here but is not obligatory). For example, could you guess (with a slight approximation not to ???? decimal places! - by doing the calculations in your head) what the price would be if the volatility were, for example, to be ????.???????? or ????????? How are you able to guess? In one or two brief sentences, what is the pattern? (???? marks)Hint: When you examine the payoff of this SQUARED DIFFERENCE security (i.e., in equation (*)), does the pattern of prices look intuitive? Why?P.S. Dont worry about the seemingly small prices. If a bank or hedge fund wanted to actually trade a security like this, they would actually trade, for example, ten million times the security that I have described and then all the answers would just get scaled up by this same constant amount. What is an error in softball? Economic expansion throughout the rest of the world raises the world interest rate. Use the MundellFleming model to illustrate graphically the impact of an increase in the world interest rate on the exchange rate and level of output in a small open economy with a floating-exchange- rate system. Be sure to label: i. the axes; ii. the curves; iii. the initial equilibrium levels; iv. the direction the curves shift; and v. the new short-run equilibrium. Directions: For the following questions, choose the best answer or respond in complete sentences. 1. PART A: Which statement best expresses the central idea of the text? A. The immune system does more harm than good when its fighting the flu because of the life-threatening symptoms it can cause. B. The influenza virus brings about many uncomfortable sensations in the body as it slowly spreads to more cells. C. Much of the discomfort that people feel when theyre infected with influenza virus is from their immune systems attack on the infection. D. While the influenza virus causes painful symptoms throughout the body, the immune system releases cells that soothe the damage that it has been done. 2. PART B: Which detail from the text best supports the answer to Part A? A. Every year, from 5 to 20 percent of the people in the United States will become infected with influenza virus. An average of 200,000 of these people will require hospitalization and up to 50,000 will die. (Paragraph 1) B. When T cells specifically recognize influenza virus proteins, they then begin to proliferate in the lymph nodes around the lungs and throat. This causes swelling and pain in these lymph nodes. (Paragraph 6) C. This results in a prolonged infection and greater lung damage. This can also set the stage for complications including secondary bacterial pneumonia, which can often be deadly. (Paragraph 8) D. Functionally, influenza infection also hinders walking and leg strength. Importantly, in young individuals, these effects are transient and return to normal once the infection was cleared. (Paragraph 14) 3. What is the authors main purpose in the text? A. to encourage people to get vaccinated for the influenza virus to avoid the symptoms B. to show how the immune system actually does more damage than the virus itself C. to explain to people that the worse they feel during the flu, the faster theyre healing D. to explain why people feel so horrible when theyre infected with the influenza virus 4. How does paragraph 9 contribute to the development of ideas in the text? A. It shows how the immune systems is responsible for symptoms beyond the parts of the body directly affected by the virus. B. It provides readers with all the symptoms that they will likely experience during the flu, improving their ability to recognize it. C. It emphasizes how the influenza virus is capable of spreading to more important areas of the body through the blood stream. D. It shows how the immune system goes overboard when its fighting an infection, spreading to areas of the body that are healthy. 5. What connection does the author draw between the effects of the influenza virus on the body and a persons age? Cite evidence from the text to support your response. Name three adaptations that helped plants survive on land, and describe how each of them helped. The annual budgeted conversion costs for a lean cell are $180,000 for 1,000 production hours. Each unit produced by the cell requires 20 minutes of cell process time. During the month, 600 units are manufactured in the cell. The estimated materials costs are $30 per unit. (Do not round per unit cost. If required, round your answers to the nearest dollar.) Required:1. Journalize the following entries for the month: a. Materials are purchased to produce 500 units.b. Conversion costs are applied to 600 units of production. c. The cell completes 450 units, which are placed into finished goods. If an amount box does not require an entry, leave it blank. Great Depression: Write a 1-2 sentence response describing how each of the following terms reflects post war disillusionment or uncertainty in Europe. How did Superman die? could u help me with this plz Plants absorb nutrients, help plants grow. Which level of organizqtion best describes this interaction between plants and soil? A) population B) organismos C) community D) ecosystem can you please give me ideas for 3 main idea paragraphs about jellyfish?