computer science 4

1632

Click here to load reader

Upload: manoj

Post on 01-Feb-2016

1.293 views

Category:

Documents


705 download

DESCRIPTION

this is the best

TRANSCRIPT

8001(project 4)Write a class for an airplane class with constructors, interface (mutators and accessors)and a test driver (main). It should be able to change altitude (up,down) and speed.The default constructor will set the altitude to 0 and speed to zero and longitude and latitudeto Boston, Massachusetts (42.3631 degrees N, 71.0064 degrees W). The overloaded constructor will set longitude and latitude to Louis Armstrong (29.9933 degrees N, 90.2581 degrees W) by passing that string to the Airplane object when it is created. If the altutude ever falls below 0 the change altutude function should announce the plane had crashed and the program exit as in the previous project. All mutators and constructor should check input for >= 0 ( no negative speeds or altitudes).(project 5)(read the above first)Add an external boolean equals() function that takes in two objects and returns true if they have same latlong and altitude. Write code to test it that announces a crash it equal.Add external equalsto()function that takes in two objects and returns true if they have same latlong and altitude. The equalsto() functions is a friend function and has direct access to altitude and latlong. The objects are pass-by-reference. Write the most efficient function you can (change to pass by reference?).

8002Programming in Windows with Visual Studio 2010 C++ and MFC. My question is about how best to store, update, and pass around program settings or options.I have a simple main GUI window/frame/dialog. On that main window I have an options button. When I click the options button I create an Options Dialog.Inside the options dialog I get a reference to the "application" (an MFC concept, globally available) and grab a reference to my custom settings class (an instance is stored in the application class. From there, I can populate my options dialog and save my options back.Perhaps I should be using Dependency injection to inject the settings into my option dialog? Or perhaps I should not even be accessing the settings from within the dialog class? MaybeI should expose the settings via set/get on the dialog class?Also, now I want to show some options right there on the main window, while still keeping them settable on the original options dialog. So now I'm wondering what a good design is for this. If I set an option on my options dialog I want it to update the options displayed on the main window.I guess this is a good spot for the Observer pattern but I'm trying to figure out how to piece it altogether in a MFC context (which as best as I can tell is basically pretty much the same as any other GUI toolkit in any other language, so if you're not into MFC I still want your comments)How should I be passing my settings around?How do I keep the GUI display of the settings in sync with each other? Such that after clicking OK on the options dialog box, the options directly shown on the main window are updated?

8003I had been programming for many years but wanted a diploma to make myself more employable. Having already been through university once, I didn't choose a full 5 year computer science major but a shorter, more practically-oriented software engineering program.I expected that it might focus more on concrete skills than on theory, but still had this idea that universities and professors like things to be correct, formal, academic. It's still science, right? Wrong - I was surprised by how sloppy many IT courses were.In an introductory course on C++ we were tested on clichA????1s like "why are globals bad" and "why are constants good", after just writing 1-2 programs. Random anecdotes without proper context. Handouts contained system(pause/cls), getch and headers like conio.h and iodos.h. One of the tasks was to print "ASCII characters" from 32 to 255, with a screenshot showing such a table printed using the Windows-1252 code page, but without mentioning encoding at all.Question: when a university/professor seems to be using inferior and/or outdated tools and methods, and the content being taught is borderline incorrect, how do you deal with it constructively and respectfully, if at all?Some answers point out that you should look beyond the programming since it is just a tool for learning about topics such as data structures and algorithms. I agree with this idea, but in this case there wasn't really any such plan behind the poor style. Most courses would simply teach another "tool" without much background theory or any "big picture". It often felt like they were quickly put together just for the sake of offering such a course.I stuck with it and finally graduated. Quality remained pretty low throughout (with a few great exceptions), and several other students have been complaining about it. As expected I have learned much more from personal projects and part-time jobs than from school, however the process of finishing school and the label "software student" seem mysteriously useful in themselves!

8004Programming languages conceptsPlease let me know if you need more time. Thank you in advance!Book link (Page 51): http://smbidoki.ir/courses/66_Concepts%20of%20Programming%20Languages%2010th-Sebesta.PDFQuestion link:http://media.Transtutorscdn.com/media%2Fabf%2Fabf46289-db60-40b8-a1c5-81971884eab4%2FphpHlzXAY.png

8005Programming languages concepts 6Please let me know if you need more time. Thank you in advance!

Show transcribed image text A. In the C language, programs often include standard headers by using the #include directive. For example, the following directive includes theheader: #include(a) Give the name of one C89 standard header that did not exist in K&R C. (b) Give the name of one C99 standard header that did not exist in C89. Note: ''K&R C'' refers to the language as defined in Kernighan and Ritchie's The C Programming Language (1978). ''C89'' refers to the language as it was standardized in 1989. ''C99'' refers to the standard that was approved in 1999. C. Ada is based on Pascal, but lacks some Pascal features. List two of them.

8006Programming languages concepts 4Please let me know if you need more time. Thank you in advance!

Show transcribed image text Programming languages concepts 4 D. Suppose that the equal lists function (See the example bellow) is called with the lists ((A B) ((C) D)) and ((A B). ((C) D)) as the arguments. How many calls of equal_lists will be performed altogether, including the original call and all recursive calls? ;LISP Example function ; The following code defines a LISP predicate function ;that takes two lists as arguments and returns True ;if the two lists are equal, and NIL (false) otherwise (DEFUN equal lists (lis1 lis2) (COND ((ATOM lis1) (EQ lis1 lis2)) ((ATOM lis2) NIL) ((equal_lists (CAR lis1) (CAR lis2)) (equal_lists (CDR lis1) (CDR lis2))) (T NIL) ) )

8007Programming languages concepts 3Please let me know if you need more time. Thank you in advance!

Show transcribed image text C. Draw a diagram showing the internal representation of the following LISP list: (((AB) C) (DE)) Please see the sample below (A(B C) D (E (F G))) Internal representation of two LISP lists

8008Programming languages concepts 2Please let me know if you need more time. Thank you in advance!https://www.fortran.com/FortranForTheIBM704.pdf

8009Programming language concept 1.5Please let me know if you need more time. Thank you in advance!

Show transcribed image text The following BNF grammar gives a (slightly simplified) syntax or import declarations in Java: (a) Using this grammar, show a parse tree and a leftmost derivation for the following sentence: import a.b.*; (a) Now, rewrite this grammar using EBNF instead of BNF. Make the resulting grammar as simple as possible. Do not change the rule for.

8010Programming language concept 1.4Please let me know if you need more time. Thank you in advance!

Show transcribed image text Convert the following EBNF rule into ordinary BNF:-> final ]{ ,} ; In this rule, [,], {, and } are metasymbols. Make the resulting grammar as simple as possible. Note, however, that you will need, more than one rule, and you will need to introduce one or more new nonterminals.

8011Programming language concept 1.3Please let me know if you need more time. Thank you in advance!

Show transcribed image text Programming language concept 1.3 The following BNF grammar appears on page 125 of Sebesta: < assign=""> - > < id=""> = < expr=""> < id=""> - > A| B|C < expr=""> - > < expr=""> + < term=""> | < term=""> < term=""> - > < term=""> * < factor=""> | < factor=""> < factor=""> - > (< expr="">) | < id=""> Rewrite this grammar so that the + operator is right associative and takes precedence over the * operator.

8012Programming language concept 1.2Please let me know if you need more time. Thank you in advance!

Show transcribed image text Using this grammar, show a parse tree and a leftmost derivation for the following Sample example: The grammar ( See above ) describes assignment statements whose right sides are arithmetic expressions with multiplication and addition operators and parentheses. For- example, the statement is generated by the leftmost derivation:

8013This is programming for engineers in C. Please supply the proper code for me to reference off of.Create a payroll program to store and calculate the payroll for a small company with a maximum of 20 employees.Program parameters are as follows:Create a menu with the following options (use a do-while loop):A or a to add employee infoD or d to display employee infoT or t to display total payrollS or s to display the info of all employeesZ or z to exit programThe information for each employee is: employee number, hours worked, pay rate per hour, tax deduction.Use an array of doubles to store employee information.Option A or a: ask the user for the employee information one value at a time and store it in the array.Please enter employee number: 2190Please enter hours worked: 32.50Please enter pay rate: 9.25Please enter tax rate deduction: 5.50Option B or b: ask the user for an employee number as integer and display the information for the corresponding employee (cast the employee number in the array to integer and then compare). If employee number does not match, output a msg. indicating A????1no such employeeA????1. If the employee number is a match, output all the employee information stored in addition to the calculated deduction and salary.Output sample:Info for employee number: 2190Hours worked: 32.50Pay rate: $ 9.25Tax deduction: 5.50 %Total pay: $ 284.89Option T or t: calculate and output the sum of the total pay of all employees.Option S or s: display the information for all employees in the same format as in option B.Option Z or z: exit the program.

8014Over my programming career I formed a habit to introduce a flag variable that indicates that the first comparison has occured, just like Msft does in its linq Max() extension method implementationpublic static int Max(this IEnumerable source){ if (source == null) { throw Error.ArgumentNull("source"); } int num = 0; bool flag = false; foreach (int num2 in source) { if (flag) { if (num2 > num) { num = num2; } } else { num = num2; flag = true; } } if (!flag) { throw Error.NoElements(); } return num;}However I have met some heretics lately, who implement this by just starting with the first element and assigning it to result, and oh no - it turned out that STL and Java authors have preferred the latter method.Java:public static B and then prove that it's a bijection. To prove |A| =0; i--) {int temp = Character.getNumericValue(shorter.charAt(i)) + Character.getNumericValue(longer.charAt(i)) + carry;result = (temp%10)+result;carry = temp/10; }// Handle carry-out, if there is one. Return resultif (carry == 1) {result = "1"+result;}return new BigNum(result);}

public BigNum mult(BigNum other){}

/** Returns a string representation of the number. No leading zeros* will exist unless the overall value is zero.** @return String representation of the BigNum*/public String toString() {return num; }

8522I need help converting the above er diagram for airline database to IE notation. Free hand draw is ok

8523I need some help configuring my program. This is what i currently have, and below that is what it has to turn out to be.public static void main(String[] args) throws FileNotFoundException {String filename = "message.txt";File fileHandle = new File(filename);Scanner inputFile = new Scanner (fileHandle);String line;while(inputFile.hasNextLine()){line = inputFile.nextLine();System.out.println(line);}inputFile.close();}}create a text file (such as message.txt)that contains a brief text message of your choice (50-100 words). Your program is read the file, show the contents of the file to the user (print the contents of the file to the console), and then ask the user for an integer number to use as a rot-n encryption key.Your program will be performing a rotational cipher over the entire set of UNICODE characters. Adjusting the value of each character in the message (by adding/subtracting the provided integer key) and output the results to BOTH the console and a file. Use the same file name as the input file, but append A????1-rotA????1 to the base file name. For example, message.txt would be encrypted as message-rot.txt.Your program should use methods for decomposition for major program tasks, including methods for:- obtaining the file name from the user- obtaining the rotational key from the user- encrypting a string- printing a file to consoleFor this program, you may assume that the user enters A????1perfectA????1 input. They will correctly enter the name of the file and an appropriate integer key, the file will exist, there will be space and permission on the hard drive to open and write the output, etc. If the user fails to enter in valid inputs, your program is allowed to crash. Note, however, that future programs may soon have the expectation that you deal with run time exceptions for this sort in a more elegant way.Be sure you write both javadoc (including method description, pre, and post condition descriptions) as well as internal documentation which describe your programs parameters, return values, and logic.Hint: Use a file name that ends in .txt so that you can check your fileA????1s contents with notepad. If you do not specify a file path your file can be found in your project folder at the same level as the folder containing your programA????1ssrcfolder.Sample output is shown belowEnter name of the text file to encrypt: message.txtEnter the rotational cipher key (an integer number): 1Original file contents:Rotational ciphers are one of the oldest (and easiestto break) encryption techniques. They are a form ofsubstitution cipher where each character is replacedwith a character/letter that is a fixed number ofpositions away in alphabetric location.Ciphered file contents:Spubujpobm!djqifst!bsf!pof!pg!uif!pmeftu!)boe!fbtjftuup!csfbl*!fodszqujpo!ufdiojrvft/!!Uifz!bsf!b!gpsn!pg!tvctujuvujpo!djqifs!xifsf!fbdi!dibsbdufs!jt!sfqmbdfe!xjui!b!dibsbdufs0mfuufs!uibu!jt!b!gjyfe!ovncfs!pg!qptjujpot!bxbz!jo!bmqibcfusjd!mpdbujpo/

8524I need help on what commands to use to get these answers. i've been getting frustrated with this homework because i know i haven't been doing it correctly. I will put the commands into my system to see if i can get the correct answer myself too. Thanks for any assistance on this.1.6 Redirection and Piping1. Get a directory listing of /home and save the listing in a file called "one" in your own home directory. Use thecatcommand to make sure that "one" contains the correct data. What are the LAST four entries?2. Get a list of everyone currently logged on and save the list in a file called "users "in your own home directory. Use thecatcommand to make sure that "users" contains the correct data. What are the LAST two entries?3. Get a list of all of the processes that are running and add this list to the end of the "users" file. Use thecatcommand to make sure that "users" contains the correct data. What are the LAST four entries?1.7 Directories1. Look at the directory listing for the root directory on Zippy. You should see some of the following directories under /.bin, boot, dev, etc, home, lib, mnt, proc, sbin, tmp, usr, varWhat (if any) directories in the above list arenotpresent on Zippy?

What (if any)) top-level directories are present on Zippy that are not listed above?

2. Change to the root directory and try to list the contents of each of the top-level directories.Which of these directories are empty?Ordinary users cannot view the contents of some of these directories.Which ones?What are the permissions for those directories?3. What is the purpose of the -F option of thelscommand? Look this up using themanpages.

4. Try running the commands:ls -F /homels -F /binWhat symbol does the -F option use to identify directories?What symbol does the -F option use to identify executable files?5. How many directories are stored under /var?6. Change to the /var directory. Try to create a directory called ddd.What error message is displayed?Why?

7. Change to your own home directory and make a directory called ddd there. This time the command should succeed.8. Cdto the ddd directory and create a file called fff using the command:touch fff9. Try to make a subdirectory called fff using the command:mkdir fffWhat error message is displayed?Why?

10. Still in the ddd directory, try to remove the ddd directory using the command:rmdir dddWhat error message is displayed?Why?11. Change to your own home directory. Try to remove the ddd directory using the command:rmdir dddWhat error message is displayed?Why?

12. Delete the file fff using the command:rm ddd/fffNow remove the ddd directory. This time the command should succeed.1.8 Files1. Get a listing of the files in your own home directory.2. What hidden files (filename begins with . ) are present in your own home directory?

3. Useheadortailto do the following: Display the last 4 lines of the file /etc/passwd. What user accounts are shown? Display the last 4 lines of the file /etc/group. What group accounts are shown? Display the first 10 lines of the file /etc/login.defs. What services (ignore comments) are shown?

Practice the copy command: Copy files in your current directory:Make sure that you are in your own home directory.Make a copy of readme called readme2. (If readme doesnA????1t exist, first create it using thetouchcommand.) Obtain a directory listing to make sure that the copy command worked.Make a copy of .bash_profile called bprofile. Obtain a directory listing to make sure that the copy command worked. Copy files from another directory:Copy the file called motd from the /etc directory to your own home directory. Obtain a directory listing to make sure that the copy command worked. Copy files to another directory:Copy the readme file to the /tmp directory. As part of the copy, rename the file readme.abc. Obtain a directory listing to make sure that the copy command worked.

In your own home directory, use thetouchcommand to create five files: one, two, three, four and five. Obtain a directory listing to make sure that the copy command worked.Practice making directories. In your own home directory, make 2 subdirectories: dir1 and dir2. Obtain a directory listing to make sure that the command worked.In dir2, make a subdirectory called dir2a. Obtain a directory listing to make sure that the command worked.Practice moving files from your own home directory: Move the file called one to the directory dir1 . Obtain a directory listing to make sure that the command worked.. Use a single command and wildcard characters to move all files in your home directory that begin with the letter "t" to dir2 . Obtain a directory listing to make sure that the command worked.Use a single command and wildcard characters to move all files in your home directory that begin with the letter "f" to the directory dir2a . Obtain a directory listing to make sure that the command worked.Use the move command to rename files. Use the move command to change the name of the file called readme2 to readme.new. Obtain a directory listing to make sure that the command worked. Create a subdirectory called aaa. Can you use the move command to change the name of aaa to dir3?YES or NO1.11 Locating and Searching Files1. Find all empty files in the/etcdirectory. How many did you find?2. Find all files under the/etcdirectory with a filename that starts with K (in uppercase). How many did you find?3. Find all files (not directories) in/etcthat start with "p". How many did you find?4. Find all files in/etcthat end with ".conf". How many did you find?5. Find all directories starting in/var. How many did you find?6. Find all files and directories in the/var/maildirectory. How many did you find?

8525I need some help with this code it will not run.import java.awt.BorderLayout;import java.awt.GridLayout;import java.awt.EventQueue;import javax.swing.ButtonGroup;import javax.swing.JTextArea;import javax.swing.border.EmptyBorder;public class Gui extends JFrame { private JPanel contentPane; public static void main(String[] args) { Gui frame = new Gui(); frame.setVisible(true); } public Gui() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 450, 300); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); contentPane.setLayout(new EmptyBorder(0, 0)); setContentPane(contentPane); JButtons button1 = new JButton("MyButton"); contenePane.add(button1, BorderLayout.WEST); JLabel labell = new JLabel("MyLabel"); contentPane.add(labell, BorderLayout.SOUTH); JComboBox comboBox = new JComboBox(); contentPane.add(comboBox, BorderLayout.NORTH); JRadioButton rdbtnNewRadioButton1 = new JRadioButton("New radio button"); contentPane.add(rdbtnNewRadioButton1, BorderLayout.EAST); ButtonGroup group = new ButtonBroup(); group.add(rdbtnNewRadioButton1); JTextArea textArea = new JTextArea("Text goes here"); textArea.setEditable(false); contentPane.add(textArea, BorderLayout.CENTER); }}

8526I need help with my class c++.// TESTING://// Test Case 1:// ------------// DESCRIPTION:// Tests that the program computes and displays the correct lucky number.//// TEST CASE INPUT DATA:// Customer name = ?????// Birthdate month = ?????// Birthdate day = ?????// Birthdate year = ?????// Height in inches = ?????// Weight in lbs = ?????//// EXPECTED OUTPUT GIVEN THE INPUT:// "?????, your lucky number is ?????. Thank you, that will be $25."//// OBSERVED OUTPUT:// //// TEST CASE RESULT:// //// Test Case 2:// ------------// DESCRIPTION:// Tests that the program computes and displays the correct lucky number.//// TEST CASE INPUT DATA:// Customer name = ?????// Birthdate month = ?????// Birthdate day = ?????// Birthdate year = ?????// Height in inches = ?????// Weight in lbs = ?????//// EXPECTED OUTPUT GIVEN THE INPUT:// "?????, your lucky number is ?????. Thank you, that will be $25."//// OBSERVED OUTPUT:// //// TEST CASE RESULT:// //**************************************************************************************************// Include the necessary header files.#include // For pow() and sqrt()#include // For cin, cout, endl#include // For string classusing namespace std;// Define a named constant CM_PER_INCH which is a double and is equivalent to 2.54.const double CM_PER_INCH = 2.54;// Define a named constant LB_PER_KG which is a double and is equivalent to 2.20462262.const double LB_PER_KG = 2.20462262;//--------------------------------------------------------------------------------------------------// FUNCTION: CalcLucky()//// DESCRIPTION// Calculates the person's lucky number using Zelda's way cool formula.//// REMARKS// I prefix the names of my parameters with a 'p' character so that when reading through the code// if I see a variable name starting with 'p' I know it is a function parameter.//--------------------------------------------------------------------------------------------------int CalcLucky(int pDate, double pHeight, int pMonth, double pWeight, int pYear){// Define an int variable named 'term1' and assign to term1 the result of evaluating://// 100 x pMonth^2//// Note: Remember, C++ does not have an exponentiation operator. To calculate pMonth^2 you can// either write pMonth * pMonth or call pow(pMonth, 2).//// pow(static_cast(pMonth), 2)int term1 = 100 * pow (static_cast (pMonth),2);// Define an int variable named 'term2' and assign to it: 10 x pDate^3. Note: if you use// the pow() function to calculate pDate^3 you will need to typecast the result of evaluating// 10 x pDate^3 to an int in order to assign it to term2. This is done using the static_cast// operator.int term2 = 10 * pow(static_cast (pDate),3);// Define an int variable named 'term3' and assign (term1 + term2) / pYear to it. Note: the// division of term1 + term2 by pYear is to be performed as integer division.int term3 = (term1 + term2) / pYear;// Define a double variable named 'term4' and assign to it: pWeight^6 / pHeight. Note: this// division is to be performed as floating-point division. If you use the pow() function to// compute pWeight^6, it will return a double so the division will naturally be performed// as floating point division.double term4 = pow (static_cast < double> (pWeight),6) / pHeight;// Calculate and return the lucky number using term3, term4, and the lucky number formula.// Note: you need to typecast term3 + sqrt(term) to an int before performing the modulus by// 10 operation (% is not defined on floating point data values).return ConvertToInt (term3 + sqrt(term4)) % 10 + 1;}//--------------------------------------------------------------------------------------------------// FUNCTION: ConvertInchToCm()//// DESCRIPTION// Converts inches to centimeters.//// REMARK// Make sure to use the named constant CM_PER_INCH in your conversion expression.//--------------------------------------------------------------------------------------------------double ConvertInchToCm(double pInches){// Implement the pseudocode.???}//--------------------------------------------------------------------------------------------------// FUNCTION: ConvertLbToKg()//// DESCRIPTION// Converts pounds to kilograms.//// REMARK// Make sure to use the named constant LB_TO_KG in your conversion expression.//--------------------------------------------------------------------------------------------------double ConvertLbToKg(double pLbs){// Implement the pseudocode.???}//--------------------------------------------------------------------------------------------------// FUNCTION: GetInt()//// DESCRIPTION// Display the prompt string pPrompt, read an int from the keyboard, and return the int.//--------------------------------------------------------------------------------------------------int GetInt(string pPrompt){cout > n;return n;}//--------------------------------------------------------------------------------------------------// FUNCTION: GetString()//// DESCRIPTION// Display the prompt string pPrompt, read a string from the keyboard, and return the string.//--------------------------------------------------------------------------------------------------string GetString(string pPrompt){string s;cout > s;return s;}//--------------------------------------------------------------------------------------------------// FUNCTION: main()//--------------------------------------------------------------------------------------------------int main(){// Display "Zelda's Lucky Number Calculator" and send two endl's to cout.???// Call GetString() asking for the customer's first name. Assign the return value to a string// variable named 'name' (note: you have to define 'name' as a string).???// Call GetInt() asking for the month of the customer's birthdate. Assign the return value to an// int variable named 'month' (which must be defined as an int).???// Call GetInt() asking for the date of the customer's birthdate. Assign the return value to an// int variable named 'date' (which must be defined as an int).???// Call GetInt() asking for the year of the customer's birthdate. Assign the return value to an// int variable named 'year' (which must be defined as an int).???// Call GetInt() asking for the customer's height in inches and assign the returned value// to an int variable named 'heightInch' (which must be defined as an int).???// Call GetInt() asking for the customer's weight in lbs and assign the returned value to// an int variable named 'weightLb' (which must be defined as an int).???// Call ConvertInchToCm() passing heightInch as the parameter and assigning the return value// to a double variable named 'heightCm' (which must be defined as a double).???// Call ConvertLbToKg() passing weightLb as the parameter and assigning the return value to// a double variable named 'weightKg' (which must be defined as a double).???// Call CalcLucky() passing date, heightCm, month, weightKg, and year as parameters. Assign the// returned value to an int variable named 'lucky' (which must be defined as an int).???// Display the customer's name, lucky number, and other required output and return from main().???return 0;}.

8527I need help with calculating the probability using C++ . Saying that I'm only dealing with 2 cards . For example, if my cards are 5 & 6 what is the probablity of me going to bust ? knowing that there are 4 jacks,4 kings and queen left . I understand the concept but I don't know how to program it .

8528Need help with a C++ ProgramWrite a program that mimics a calculator in a shopping cart. Your program must display a simple menu to the user with the following choices:(a)Add an item to the cart.(t)Running total.(q)Quit.If the choice is (a), you must let the user add an item by name (any text with spaces). Then you must ask for the price of the item (read in double), and then display the total so far immediately. That would be the running total. Then display the menu again.If the choice is (t), give them the total so far, then display the menu again.If the choice is (q), then give them the total and quit the program.

8529Need help asapShow transcribed image text Sections 4.3-4.6 *4.8 (Find the character of an ASCII code) Write a program that receives an ASCII code (an integer between 0 and 127) and displays its character. Here is a sample run: Enter an ASCII code: 69 character for ASCLL code 69 is E

8530Need help asap JAVAShow transcribed image text 4.22 (Check substring) Write a program that prompts the user to enter two strings and reports whether the second string is a substring of the first string.

8531I need help answering this questions. Please give an excellent answer for an "A" grade.(1) What type of output does the Javadoc command generate and how do you view the output?(2) What is a Java archive?(3) What command is used to create archive? Explain using an example.(4) What are the steps necessary to create a JAR file where the main entry points is identified?(5) What command is used to execute a JAR file which has a main entry point?

8532I just need halp writing a python program for nuber 26 plz my teacher kinda explained it I didnt retain

8533Need some good explanation with the following question:(1) How do you get access to a Java.awt.Graphics object? How is it created and how do you use it once you have it?(2) Let's start by discussing how to setup a program to respond to events from any one of these sources. How do you create the necessary listener class?

8534I need a good explanation to the following Java progrmming questions:(1) What are the benefits of documenting our programs?(2) How cn you related classes into a JAR file which can be executed?

8535i need full c++ program and screenshot for running the program(1) Include the following statements in C++ code to evaluate outcomes of statements:int x = 5, y = 5;cout x; cout > n; poly = powX = x; i = 2; // initialized to 2, and in the first iteration calculating 2 * 3 = 3! numTerms = 1; while (numTerms < n) { powX *= x * x; factorial *= i * (i + 1); i += 2; sign = -sign; poly += sign * powX / factorial; ++numTerms; } cout = 0.0 && thisValue limit );101 return thisValue;102 }103104 private void displayMenu()105 {106 System.out.println("\n\nPlease enter one of the following:");107 System.out.println(" D - to test the debit method");108 System.out.println(" C - to test the credit method");109 System.out.println(" V - to display the values of the Account");110 System.out.println(" M - to re-display this menu");111 System.out.println(" Q - to exit this test\n");112 }CSC-240 Java Programming A????1 Exam One Listings Page 5 of 6113114 private char getUserCommand()115 {116 char thisChar;117 boolean goodChar;118 do119 {120 System.out.print("Enter a command letter: ");121 thisChar = userInput.next().toUpperCase().charAt(0);122 goodChar = (thisChar == 'D' || thisChar == 'C' || thisChar == 'M' ||123 thisChar == 'Q' || thisChar == 'V');124 if( !goodChar )125 System.out.println("That is not a valid command letter");126 }127 while( goodChar == false );128 return thisChar;129 }130 }

8633Which methods of theAccountTesterclass use loops to validate the user's input? (Check all that apply.)Question 20 options:exerciseTransactions (line 45 of Listing 2).

exerciseTransactions(line 59 of Listing 2).

getUserValue (line 90 of Listing 2).

getUserCommand(line 114 of Listing 2).Listing 2 below:23 import java.util.Scanner;4 import java.util.Random;56 public class AccountTester7 {8 Random randomNumbers = new Random();9 Scanner userInput = new Scanner(System.in);1011 public void testAccountClass()12 {13 System.out.println("\n\n*** Testing the Account Class ***");1415 System.out.printf("\nCurrent Interest Rate: %.2f%%", Account.CURRENT_RATE *16 100.0);1718 System.out.println("\n\nCreating Account Objects");19 Account accountOne = new Account(5000.0);20 Account accountTwo = new Account(accountOne);21 accountOne.displayValues("\nInitial Values for Account One:");22 accountTwo.displayValues("\nInitial Values for Account Two:");2324 System.out.println("\n\nExercising Account Transactions");25 accountOne.credit(0.0);26 accountOne.debit(-6);27 accountTwo.credit(-1.50);28 accountTwo.debit(100.0);29 accountTwo.debit(5000);30 exerciseTransactions(accountOne, 100, 500.0);31 exerciseTransactions(accountTwo, 250.0);32 accountOne.displayValues("\n\nUpdated Values for Account One:");33 accountTwo.displayValues("\nUpdated Values for Account Two:");3435 System.out.println("\n\nExercising Future Value Calculators");36 System.out.printf(" Calculation 1: $%.2f\n", accountOne.futureValue(6.5,37 0.05));38 System.out.printf(" Calculation 2: $%.2f\n", accountOne.futureValue(15,39 0.05));40 System.out.printf(" Calculation 3: $%.2f\n", accountTwo.futureValue(6.5));41 System.out.printf(" Calculation 4: $%.2f\n", accountTwo.futureValue(15));42 System.out.println("\n\n*** Testing Complete ***\n");43 }4445 private void exerciseTransactions(Account thisAccount, int testCount,46 double limit)47 {48 int count = 0;49 while( count < testCount )50 {51 if( (count % 3) != 0 )52 thisAccount.credit(getDataValue(limit));53 else54 thisAccount.debit(getDataValue(limit));55 count++;CSC-240 Java Programming A????1 Exam One Listings Page 4 of 656 }57 }5859 private void exerciseTransactions(Account thisAccount, double limit)60 {61 char answer;62 displayMenu();63 do64 {65 answer = getUserCommand();66 switch( answer )67 {68 case 'D':69 thisAccount.debit(getUserValue(limit));70 break;71 case 'C':72 thisAccount.credit(getUserValue(limit));73 break;74 case 'V':75 thisAccount.displayValues();76 break;77 case 'M':78 displayMenu();79 break;80 }81 }82 while( answer != 'Q' );83 }8485 private double getDataValue(double maxValue)86 {87 return 1.0 + randomNumbers.nextDouble() * maxValue;88 }8990 private double getUserValue(double limit)91 {92 double thisValue;93 do94 {95 System.out.printf("Please enter a value (0.0 - %.2f): ", limit);96 thisValue = userInput.nextDouble();97 if( !(thisValue >= 0.0 && thisValue limit );101 return thisValue;102 }103104 private void displayMenu()105 {106 System.out.println("\n\nPlease enter one of the following:");107 System.out.println(" D - to test the debit method");108 System.out.println(" C - to test the credit method");109 System.out.println(" V - to display the values of the Account");110 System.out.println(" M - to re-display this menu");111 System.out.println(" Q - to exit this test\n");112 }CSC-240 Java Programming A????1 Exam One Listings Page 5 of 6113114 private char getUserCommand()115 {116 char thisChar;117 boolean goodChar;118 do119 {120 System.out.print("Enter a command letter: ");121 thisChar = userInput.next().toUpperCase().charAt(0);122 goodChar = (thisChar == 'D' || thisChar == 'C' || thisChar == 'M' ||123 thisChar == 'Q' || thisChar == 'V');124 if( !goodChar )125 System.out.println("That is not a valid command letter");126 }127 while( goodChar == false );128 return thisChar;129 }130 }

8634Which methods of theAccountclasscannotbe seen or called from theAccountTesterclass? (Check all that apply.)Question 23 options:showMessage(line 94 of Listing 1).

displayValues(line 63 of Listing 1).

getBalance(line 53 of Listing 1).

futureValue(line 84 of Listing 1).Listing 1 below:3 public class Account4 {5 private double balance;6 private int credits;7 private int debits;8 private double totalCredits;9 private double totalDebits;10 public static final double CURRENT_RATE = 0.045;1112 public Account(double initialBalance)13 {14 if( initialBalance >= 0.0 )15 balance = initialBalance;16 else17 showMessage("? Incorrect initial balance: $%.2f\n", initialBalance);18 }1920 public Account(Account fromAccount)21 {22 balance = fromAccount.getBalance();23 }2425 public void credit(double amount)26 {27 if( amount > 0.0 )28 {29 balance += amount;30 totalCredits += amount;31 credits++;32 }33 else34 showMessage("? Invalid amount for a Credit: $%.2f\n", amount);35 }3637 public void debit(double amount)38 {39 if( amount > 0.0 )40 if( balance >= amount )41 {42 balance = balance - amount;43 totalDebits = totalDebits + amount;44 debits++;45 }46 else47 showMessage("? Debit of $%.2f exceeds balance of $%.2f", amount,48 balance);49 else50 showMessage("? Invalid amount for a Debit: $%.2f\n", amount);51 }52 CSC-240 Java Programming A????1 Exam One Listings Page 2 of 653 public double getBalance()54 {55 return balance;56 }5758 public void displayValues()59 {60 displayValues("Account Values:");61 }6263 public void displayValues(String displayMessage)64 {65 showMessage(displayMessage);66 showMessage(" Balance is $%.2f\n", balance);67 showMessage(" %d credits totaling $%.2f\n", credits, totalCredits);68 showMessage(" %d debits totaling $%.2f\n", debits, totalDebits);69 }7071 public double futureValue(double years, double rate)72 {73 return balance * Math.pow(1.0 + rate, years);74 }7576 public double futureValue(int years, double rate)77 {78 double amount = balance;79 for( int count = 0; count < years; count++ )80 amount = amount + (amount * rate);81 return amount;82 }8384 public double futureValue(double years)85 {86 return balance * Math.pow(1.0 + CURRENT_RATE, years);87 }8889 private void showMessage(String message)90 {91 System.out.println(message);92 }9394 private void showMessage(String message, double firstValue)95 {96 System.out.printf(message, firstValue);97 }9899 private void showMessage(String message, double firstValue, double secondValue)100 {101 System.out.printf(message, firstValue, secondValue);102 }103104 private void showMessage(String message, int firstValue, double secondValue)105 {106 System.out.printf(message, firstValue, secondValue);107 }108 }

8635Method of Copying my macro entries into the Editor fasterI have a project where I have over 12 different text strings, each over 200 characters long and am trying to find a way to enter them faster into the macro I'm recording. They will eventually be read by several machine learning algorithms, so accuracy is key (why I'd like to eliminate human error via poor keystrokes from the process)So, instead of typing each of the 12 entries character by character, I'd like to simply copy them from another spreadsheet where I'm certain they're correct and input them into the macro I'm recording. Does anyone know how I would achieve this?Currently when I try to copy it in from another spreadsheet, the recorder registers the copy keystrokes as what I want to do (which makes sense), leading to an 'out of range' error.Thanks !!

8636Method 1: createArrayWrite a method that creates an integer array of size 100. Once created, use some type of loop to fill the array with random integers. Make sure these integers are in the range [0-99]. This method should accept no parameters and return an integer array. Therefore, the method header should look as follows: public static int[] createArray()Method 2: statsDisplayWrite a method that performs some rudimentary statistics on the recently created array. The statistics to take are as follows:Count and display the amount of even numbers (Note: You do not have to print the actual numbers).Count and display the amount of odd numbers (Note: You do not have to print the actual numbers).Calculate and display the average.This method should accept as input an int array. Since we are doing some simple printing, and do not actually need to return any values, use the void return type. Therefore, the header should look as follows:public static void statsDisplay(int[] intArray)

8637The merge sort algorithm sorts a list of n numbers x1, . . . , xn. The algorithm works by first testing if n = 1, and if so does nothing. Otherwise, the algorithm recursively calls itself on the first [n/2] entries, and then calls itself on the last [n/2] entries, then A????1shufflesA????1 them together by iterating through the two parts, selecting the minimum elements from each part until creating a sorted list of n entries. If tn is the time it takes to run the merge sort algorithm on a list of n numbers, then t1 = 1 (only need to test one operation), and (roughly)tn = 2t[n/2]+ nUsing this recurrence relation and strong induction, prove that tn = 1.

8638The merge sort algorithm sorts a list of n numbers x1, . . . , xn. The algorithm works by first testing if n = 1, and if so does nothing. Otherwise, the algorithm recursively calls itself on the first [n/2] entries, and then calls itself on the last [n/2] entries, then A????1shufflesA????1 them together by iterating through the two parts, selecting the minimum elements from each part until creating a sorted list of n entries. If tn is the time it takes to run the merge sort algorithm on a list of n numbers, then t1 = 1 (only need to test one operation), and (roughly)tn = 2t[n/2e]+ nUsing this recurrence relation and strong induction, prove that tn = 1.

8639The merge sort algorithm sorts a list of n numbers x1, . . . , xn. The algorithm works by first testing if n = 1, and if so does nothing. Otherwise, the algorithm recursively calls itself on the first [n/2] entries, and then calls itself on the last [n/2] entries, then A????1shufflesA????1 them together by iterating through the two parts, selecting the minimum elements from each part until creating a sorted list of n entries. If tn is the time it takes to run the merge sort algorithm on a list of n numbers, then t1 = 1 (only need to test one operation), and (roughly)tn = 2t[n/2e]+ nUsing this recurrence relation and strong induction, prove that tn = 1.

8640*What memory addresses on the 68HC11E9 are used for RAM, ROM, EEPROM, and registers? How large are these memories in decimal, binary and hexadecimal?*Show the 8 bit binary contents that would be contained in memory if the values 27, $75, 253, and 0 where stored in memory locations $1000 to $1003.

8641Megan signs a contract to rent a house and the rent is $1200 per month.Her monthly rent increases each year by the amount of inflation for that year.If,for two years, the inflation rate is 4.5% and 5.1% respectively, find her rent after these two years ??Thanks for help !!

8642You meet three inhabitans Smullyons Island. A claim that "C is telling the truth", B says Either C is telling the truth or I am but not both of us, and C says that " B is lying." who is lying?

8643May have been posted already, it didn't show, JAVAw/image: : Write a program that prompts user to enter the x, y coordinates, width, and height of two rectangles and deter mines wheather the second one is inside the first or overlaps with the first, as shown in following figure. Test your program in all cases

8644(may have already posted, didn't show) Java: A program of payment management system of a company. Assume the program allows the user to input employeeA????1s salary and increasement rate. We have following declarations of variables:double person_salary, increase_rate; // store employeeA????1s salary and annual increase rate.double total, average; // store the total employeeA????1s salary and averageint employee_num; // store the number of employees.// Assume we had declared a Scanner object named A????1inputA????1, we get following inputSystem.out.print(A????1Enter employeeA????1s salary: A????1);person_salary = input.nextDouble();System.out.print(A????1Enter employeeA????1s increase rate: A????1);increase_rate = input.nextDouble();Write a program to take userA????1s input for base salary, increase rate and calculate the final salary. You need to validate the input data from user and display result. Salary is usually positive, increase rate can be zero or larger. Make sure your program gives user three chances to input if the data is not valid.

8645The maximum load that can be placed at the end of a symmetrical wooden beam, such as the rectangularbeam can be calculated as the following: L = (S*I) / (d*c)L is the maximum weight in lbs of the load placed on the beam.S is the stress in lbs/in2.I is the beamA????1s rectangular moment of inertia in units of in4.d is the distance in inches that the load is placed from the fixed end of the beam (the A????1moment armA????1 ).c is one-half the height in inches of the symmetrical beam.For a 2A????1 A????1 4A????1 wooden beam, the rectangular moment of inertia is given by this formula:I = ((base) * (hight)^3) / 12 =((2) * (4)^3) / 12 = 10.67^4c = 0.5 * 4 = 2 ina) Using this information, design, write, compile, and run a C++ program that computes the maximumload in lbs that can be placed at the end of an 8-foot 2A????1 A????1 4A????1 wooden beam so that the stress on the fixedend is 3000 lb/in2.b) Use the program developed in Exercise 3a to determine the maximum load in lbs that can be placed atthe end of a 3A????1 A????1 6A????1 wooden beam so that the stress on the fixed end is 3000 lbs/in2.

8646Matrix multiplication:Write a C++ program to compute the product of two matrices. You are required to use the template class vector to represent a matrix. (See the sample code below on how to create and initialize a 2d-matrix using vectors.) Specifically, your program will include the main( ) function and a second function multiply_matrices( ). The main() function willallow the end-users to provide the dimensionality of the two matrices A and B, and subsequently the content of A and Bcall the multiply_matrices() function to compute the product of A and Bprint out the multiplication resultFile I/Os:Given two text files, each of which contains a a sorted list of integers (one integer per line) in non-decreasing order, write a C++ program to merge these two input files into a third file in which all the numbers remain their sorted order. Your program will include the main() function and another function that merges the two files. Specifically, the main() function will ask a user to type in the names of the two input files. It will then call the merging function to merge the two files. Finally, it informs the user the name of the merged file.Note that you are not allowed to first load all the numbers in the two files into an array or vector then apply a sorting algorithm to this array.Random accesses to a file.The file posted here on iLearn contains a formatted list of 9999 integers that are randomly generated in the range of [1,9999]. Each integer occupies one single line and takes 4 characters' space per line. Alternatively, you can think that each number takes 5 characters' space, four for the number and one for the newline character. Write a C++ program using the seekg() and seekp() functions to insert the numbers 7777 through 7781 between the 6000-th and 6001-st numbers of the input file. Below are a few useful tips:The tellg() and tellp() functions return the position of the current character in an input stream or output stream, respectively.You are strongly recommended to use the tellg() function to first learn about the starting position of each integer. This will help you locate the exact starting position to insert the new numbers.You can use the width() function to specify the number of characters you'd like an integer to occupy.In addition to the "output" operator (ProductCode); printf("enter the Product description : "); fflush(stdin); fgets(ptr->Description, 120, stdin); printf("enter the Product Name : "); fflush(stdin); fgets(ptr->ProductName, 50, stdin); printf("enter the products location : "); fflush(stdin); fgets(ptr->Location, 8, stdin); printf("enter the Unit cost for this product : "); fflush(stdin); scanf("%f", &ptr->UnitCost); printf("enter the retail price for this product : "); fflush(stdin); scanf("%f", &ptr->Price); printf("enter the quantity on hand for this product : "); fflush(stdin); scanf("%d", &ptr->Quantity); } else { fscanf(fp,"%d%*c", &ptr->ProductCode); fgets(ptr->Description, 120, fp); fgets(ptr->ProductName, 50, fp); fgets(ptr->Location, 8, fp); fscanf(fp,"%f", &ptr->UnitCost); fscanf(fp,"%f", &ptr->Price); fscanf(fp,"%d", &ptr->Quantity); }}int compareProdCode(void *p1, void *p2){ if (((Product *)(p1))->ProductCode < ((Product *)(p2))->ProductCode) return -1; else if (((Product *)(p1))->ProductCode >((Product *)(p2))->ProductCode) return 1; else return 0;}void displayData(void *ptr){ printf("\n\nproduct code : %d\n",((Product *)(ptr))->ProductCode); printf("Product description : %s", ((Product *)(ptr))->Description); printf("Product Name : %s", ((Product *)(ptr))->ProductName); printf("products location : %s", ((Product *)(ptr))->Location); printf("Unit cost : %.2f\n", ((Product *)(ptr))->UnitCost); printf("retail price : %.2f\n", ((Product *)(ptr))->Price); printf("quantity on hand : %d\n", ((Product *)(ptr))->Quantity);}void displayOptions(){ printf("\n\n\t\tWelcome to the Binary Tree processing applicaiton\n"); printf("\t\tThe following is a menu of options for your selection\n"); printf("\n"); printf("\t\tTo add an item to the tree, enter A\n"); printf("\t\tTo search the tree for an item to display, enter an S\n"); printf("\t\tto display the contents of the tree, enter a L\n"); printf("\t\tto exit the application, enter a Q\n"); printf("\n");}2-#include #include #include #include #include "appStuff.h" #include "BinaryTree.h" int main() { FILE *fp; Node *Root = NULL, *newNode, *current; char Choice; Product *myStuff; int(*Compare)(void*,void*) = compareProdCode; fp = fopen("teststuff.txt", "r"); if (fp == NULL) printf("file open failed"); else { do{ myStuff = getDataNode(); getData(myStuff, fp); if (myStuff->ProductCode > 0) { newNode = getTreeNode(myStuff); if (Root == NULL) Root = newNode; else AddNode( Root, newNode); } }while (!feof(fp)); /* inOrder(Root); */ fclose(fp); do { displayOptions(); fflush(stdin); scanf("%c", &Choice); switch (toupper(Choice)) { case 'A': myStuff = getDataNode(); getData(myStuff, stdin); newNode = getTreeNode(myStuff); AddNode(Root, newNode); break; case 'S': myStuff = getDataNode(); printf("Enter the product code that you wish to find : "); fflush(stdin); scanf("%d", &myStuff->ProductCode); current = SearchTree(Root, myStuff); displayData(current->dataItem); break; case 'L': inOrder(Root); break; case 'Q': printf("processing has ended. here is a display of the tree contents\n\n"); inOrder(Root); } } while (toupper(Choice) != 'Q'); } }3-typedef struct NODE { void *dataItem; struct NODE *llink, *rlink; }Node; void inOrder(Node *ptr) { if (ptr->llink != NULL) inOrder(ptr->llink); displayData(ptr->dataItem); if (ptr->rlink != NULL) inOrder(ptr->rlink); } Node *getTreeNode(void *ptr) { Node *newNode; newNode = (Node *)malloc(sizeof (Node)); newNode->dataItem = ptr; newNode->llink = NULL; newNode->rlink = NULL; return newNode; } void AddNode( Node *root, Node *newNode) { Node *current = root; int attached = 0; if (((Product *)current->dataItem)->ProductCode > ((Product *)newNode->dataItem)->ProductCode) { if (current->llink == NULL) { current->llink = newNode; } else AddNode(current->llink, newNode); } else { if (current->rlink == NULL) { current->rlink = newNode; } else AddNode(current->rlink, newNode); } } Node *SearchTree( Node *root, void *ptr) { Node *current = root; int found = 0; while (current != NULL && found == 0) { if (((Product *)current->dataItem)->ProductCode == ((Product *)ptr)->ProductCode) found = 1; else if (((Product *)current->dataItem)->ProductCode < ((Product *)ptr)->ProductCode) current = current->rlink; else current = current->llink; } return current; } 4- 16552 #2 phillips head screwdriver with rubber grips for insulation #2 phillips 12st56 0.67 1.25 24 16551 #1 phillips head screwdriver with plastic grips #1 phillips 12st55 0.52 0.95 30 16723 #2 flat blade screwdriver with extended shaft #2 long flat 12st24 0.88 1.75 15 16729 #1 flat blade screwdriver with plastic grips #1 flat blade 12st27 0.60 1.15 28 15234 5-1/4" circular saw with battery 5.25 circular saw 14pt73 37.24 40.50 6

8712What are the the main differences between VoIP service and PSTN service. 2. Can we make calls between VoIP and PSTN subscribers? If yes, explain how?

8713main() contains a for loop that repeats 20 times.How did the author choose this value?What delay is produced (not including any overhead) by the T0Delay() function?

8714macro to subtract one day from a date in a cellI have a todays date in a cell (D4). I want to create a macro to attach to a button so that each time the button is pressed it will subtract one day from the date displayed in the cell. For example, if todays date is in the cell, 12thFeb15, if a user presses the button three times I want the macro to change the date to the 9th Feb 2015.Thanks !!

8715Macro to export certain sheet to CSV with a chosen save locationHello,I would like to create a Macro within excel so that when a button is clicked on sheet1, a dialog box appears asking for a save location. Then I would like sheet2 to then get saved as a CSV in that specific location. If anyone could help that would be great!Thanks !!

8716I'm writing a program that needs to test if a file is equivalent to one or more other files. To accomplish this, every time we see a new file we stat the file and get the size.We use the size as a key and if we've never seen the size before than we know that's a new file.If we have seen that size before we were planning to md5 the first 4k and last 4k of the target file and check to see if that hash has been seen in list associated with the size key.I don't want to hash the whole file since these files can be rather large (largest I've seen so far is 90G).The goal is to avoid spending a lot of time on redundant file comparisons. Will this algorithm work, and can it be improved?More details on my particular problem: I'm attempting to deduplicate a decently sized set of data ( 2Pb ) that contains a large amount of time stamped files (about 40%) created from syslog on FreeBSD machines. Before I start chewing through that many files line by line I wanted to make sure that the file I was looking at hadn't been seen before.

8717I'm writing a code that solves a quadratic formula and I can't figure out why I keep getting thiese errorsPrintf("Welcome to Quadratic Solutions \n");^quadratic.cpp:13:5: error: expected A????1(A????1 before A????1dA????1if d >= 0^quadratic.cpp:20:2: error: A????1elseA????1 without a previous A????1ifA????1else#include #include int main (){ float a,b,c,d,x1,x2; d=(b*b)-(4*a-c); Printf("Welcome to Quadratic Solutions \n"); Printf("Enter Your A, B, C variables \n"); scanf("%f", &a),("%f", &b),("%f", &c); if d >= 0 { x1=(-b+sqrt(d))/(2*a); x2=(-b-sqrt(d))/(2*a); printf("The roots are ("%f", & x2) and ("%f", & x1)\n"); } else { d=d*(-1); printf("The roots are imaginary!\n"); }

}

8718I'm writing a C++ program using a class model:- balance: double- interestRate: double- interest: double- transactions: integer+ setInterestRate (double ): void+ makeDeposit(double): void+ withdraw(double ): bool+ calcInterest( ): void+ getInterestRate( ): double const+ getBalance( ): double const+ getInterest( ): double const+ getTransactions( ): double constI have the header file down, but I'm not even sure where to start for the definition part. Once I get that the testing part will be easy. Can anyone help me with the definition?

8719I'm working on a project, I have a question regarding the architecture:Say I have a many python scripts on my server and there's main.py which contains all the classes. And there's a script called copymain.pyA user named alex signs up and the url of his site is stored in mariadbcopymain.py checks if a user has signed up every 5 min using cronwhen copymain.py detects that alex has signed up, it creates a copy of main.py rename it to alex.py, moves alex.py to scriptFolder, and writes the url of alex's site to alex.pyCron or Celery (haven't decided yet) will run all the .py files inside scriptFolder every lets say 15 minsWhy I picked this design?This design will let me get rid of many stack and queues and threading in my script and make it simpler, it is a simple solution, and it works perfectly. If I need to edit main.py, all I have to do is edit the modules imported, so I don't need to edit individual copies.I think that by copying the files, I could easily deploy it on many servers. Move some .py files to this server, others to that and I'm done. These are the two main reasons.Say you have to generate RSS for websites, for some reason there's a user called fred that has a problem, there's an issue that needs a special script, because we all know that every website has its own design and many errors occur when scrapping and dealing with html, you can go to fred.py and edit your script for that user.Is it the most efficient architecture? Or should I use one file, get the users from database? My script currently does that, but I prefer to copy for the reasons stated above, a simple scheduling would do. I need to make sure that no matter how many users I have, the website of every user will be processed at exactly the time I promised when they signed up, when there's too many of them and I notice it's being slow, I just buy upgrade or buy another server. I'm afraid of creating too many threads and having to worry about it as it scales. Copying seems the simplest solution, Linux uses cron all the time for entire directories.

8720I'm working on a .NET application and I'm wondering if I should use separate methods to handle the click events of two different buttons. They essentially do the same thing, just on different objects on the form, in this case two separate maps.Same method:Private Sub SingleButtonHandler(sender As Object, e As EventArgs) Handles btnToggleSatNew.Click, btnToggleSatOld.Click If sender Is btnToggleSatNew Then Me.NewMap.ToggleSateliteView() Else Me.OldMap.ToggleSateliteView() End IfEnd SubSeparate Methods:Private Sub btnToggleSatOld_Click(sender As Object, e As EventArgs) Handles btnToggleSatOld.Click Me.OldMap.ToggleSateliteView()End SubPrivate Sub btnToggleSatNew_Click(sender As Object, e As EventArgs) Handles btnToggleSatNew.Click Me.NewMap.ToggleSateliteView()End SubWhat's the overhead of checking if the two objects are the same? Is one version easier to read than the other? Or should I be doing something completely different?

8721I'm working on a middle-tier project which encapsulates the business logic (uses a DAL layer, and serves a web application server [ASP.net]) of a product deployed in a LAN. The BL serves as a bunch of services and data objects that are invoked upon user action.At present times, the DAL acts as a separate application whereas the BL uses it, but is consumed by the web application as a DLL. Both the DAL and the web application are deployed on different servers inside organization, and since the BL DLL is consumed by the web application, it resides in the same server.The worst thing about exposing the BL as a DLL is that we lost track with what we expose. Deployment is not such a big issue since mostly, product versions are deployed together.Would you recommend migrating from DLL to WCF service? If so, why? Do you know anyone who had a similar experience?

8722I'm working at a company that uses Excel files to store product data, specifically, test results from products before they are shipped out. There are a few thousand spreadsheets with anywhere from 50-100 relevant data points per file. Over the years, the schema for the spreadsheets has changed significantly, but not unidirectionally - in the sense that, changes often get reverted and then re-added in the space of a few dozen to few hundred files. My project is to convert about 8000 of these spreadsheets into a database that can be queried. I'm using MongoDB to deal with the inconsistency in the data, and Python.My question is, what is the "right" or canonical way to deal with the huge variance in my source files? I've written a data structure which stores the data I want for the latest template, which will be the final template used going forward, but that only helps for a few hundred files historically. Brute-forcing a solution would mean writing similar data structures for each version/template - which means potentially writing hundreds of schemas with dozens of fields each. This seems very inefficient, especially when sometimes a change in the template is as little as moving a single line of data one row down or splitting what used to be one data field into two data fields.A slightly more elegant solution I have in mind would be writing schemas for all the variants I can find for pre-defined groups in the source files, and then writing a function to match a particular series of files with a series of variants that matches that set of files. This is because, more often that not, most of the file will remain consistent over a long period, only marred by one or two errant sections, but inside the period, which section is inconsistent, is inconsistent.For example, say a file has four sections with three data fields, which is represented by four Python dictionaries with three keys each.For files 7000-7250, sections 1-3 will be consistent, but section 4 will be shifted one row down. For files 7251-7500, 1-3 are consistent, section 4 is one row down, but a section five appears. For files 7501-7635, sections 1 and 3 will be consistent, but section 2 will have five data fields instead of three, section five disappears, and section 4 is still shifted down one row. For files 7636-7800, section 1 is consistent, section 4 gets shifted back up, section 2 returns to three cells, but section 3 is removed entirely. Files 7800-8000 have everything in order.The proposed function would take the file number and match it to a dictionary representing the data mappings for different variants of each section. For example, a section_four_variants dictionary might have two members, one for the shifted-down version, and one for the normal version, a section_two_variants might have three and five field members, etc. The script would then read the matchings, load the correct mapping, extract the data, and insert it into the database.Is this an accepted/right way to go about solving this problem? Should I structure things differently? I don't know what to search Google for either to see what other solutions might be, though I believe the problem lies in the domain of ETL processing. I also have no formal CS training aside from what I've taught myself over the years. If this is not the right forum for this question, please tell me where to move it, if at all. Any help is most appreciated.Thank you.

8723I'm wiritng a proram for a virtual robot to follow another robot which avoids the walls by turning and moving until next wall, i'm using distance and atan2() functions to solve the direction problem, the robot is at a constant speed, it cant be changed. I'm not sure how to call my functions in a way to make the robot travel behind the red robot.here is the code, my functions are in bold, i havn't added any code to b executed for my robot.#include #include #include #include #include #include

/************************************/// place your functions herefloat subtract(float x1, float x2){ x2=red_x; x1=blue_x; float xF; xF=x1-x2; return xF;}float subtract(float y1, float y2){ y2=red_y; y1=blue_y float yF; yF=y1-y2; return yF;}

float sqrt(xf^2, yf^2){ float D; D=sqrt((xF*xF)+(yF*yF)); return D;}float atan2(yF, xF){ float th; th=atan2(yF, xF); return th;}/************************************/

/***ignore these functions***/double red_x, red_y, blue_x, blue_y;double red_theta, blue_theta;double getRotationFromMsg( geometry_msgs::Quaternion q ){double yaw;yaw = tf::getYaw(q);return yaw;}void odomCallback(const nav_msgs::Odometry::ConstPtr& msg){red_x = msg->pose.pose.position.x;red_y = msg->pose.pose.position.y;red_theta = getRotationFromMsg(msg->pose.pose.orientation);}void odom2Callback(const nav_msgs::Odometry::ConstPtr& msg){blue_x = msg->pose.pose.position.x;blue_y = msg->pose.pose.position.y;blue_theta = getRotationFromMsg(msg->pose.pose.orientation);}

int main( int argc, char* argv[] ){ // this code initializes a connection to the robot ros::init(argc,argv,"follower"); ros::NodeHandle nh; ros::Rate loop_rate(10); ros::Publisher cmd_vel = nh.advertise("/robot_1/cmd_vel",1000);ros::Subscriber odom_sub = nh.subscribe("/robot_0/base_pose_ground_truth",1000,odomCallback);ros::Subscriber odom2_sub = nh.subscribe("/robot_1/base_pose_ground_truth",1000,odom2Callback); geometry_msgs::Twist cmd_vel_msg; double des_vel = 1.0; // loop forever while( ros::ok() ) { // by default, the robot will move forward at 1 meter / second double lvel = des_vel; // by default, the robot will not turn at all double rvel = 0;

//place your code here /***************************************/ /***************************************/ // send the speeds to the robot cmd_vel_msg.linear.x = lvel; cmd_vel_msg.angular.z = rvel; cmd_vel.publish(cmd_vel_msg); ros::spinOnce(); loop_rate.sleep(); } return 0;}

8724I'm in a Web Scripting class for JavaScript and having a hell of a time with doing this question, I have tried to find similar code to break down and figure it out, but I can't seem to find any.1. In the JavaScript file, write the code for calculating and displaying the salestax and invoice total when the user clicks on the Calculate button.2. If you havenA????1t already done so, add data validation to this application. Thesubtotal entry should be a valid, positive number thatA????1s less than 10,000. Thetax rate should be a valid, positive number thatA????1s less than 12. The errormessages should be displayed in the span elements to the right of the textboxes, and the error messages should be: "Must be a positive number less than $10,000" and "Must be a positive number less than 12.3. Add JavaScript code that moves the cursor to the Subtotal field when the application starts and when the user clicks on the Calculate button.4. Add the JavaScript event handler for the click event of the Clear button. This should clear all text boxes, restore the starting messages, and move the cursor to the Subtotal field.5. Add JavaScript event handlers for the click events of the Subtotal and Tax Rate text boxes. Each handler should clear the data from the text box.Here is the HTML:

Sales Tax Calculator

Sales Tax CalculatorEnter Subtotal and Tax Rate and click "Calculate".

Subtotal:

Enter order subtotal
Tax Rate:

Enter sales tax rate (99.9)
Sales Tax:
Total:


and here is the JavaScript I have:var $ = function (id) {return document.getElementById(id);}var calculate_click = function () { var subtotal = parseFloat( $("subtotal").value );var taxRate = parseFloat( $("tax_rate").value ); $ salesTax (subtotal * (taxRate / 100)); $ total (subtotal + salesTax);}var clear_click = function (clear) { return document.getElementByID(clear); document.getElementByID("subtotal").value = ""; // Clear Subtotal Box document.getElementByID("tax_rate").value = ""; // Clear Tax Rate Box document.getElementByID("sales_tax").value = ""; // Clear Sales Tax Box document.getElementByID("total").value = ""; // Clear Total Box $("subtotal").focus();}window.onload = function () {$("calculate").onclick = calculateClick;$("clear").onclick = clear_click; $("subtotal").onclick = clearSubtotal; $("tax_rate").onclick = cleartax_rate; $("sales_tax").onclick = clearsales_tax;$("subtotal").focus();}

8725I'm having two issues: with negative numbers working when I input them into this program, and it repeating the same power of three. This purpose of the program is to solve for any value in between -121 and 121, using powers of three (Example: 13 = 9 + 3 + 1). Can anyone help with it? I'm just looking for a simple fix, an extra function or something, not a complete rewrite of code, please. Thanks! (C++, this is my current code):#include #include #include #include using namespace std;const int SIZE = 5;const int powT[SIZE] = { 1, 3, 9, 27, 81 };int getClosest(int key){int smallest = powT[4];int answer = powT[0];if (abs(powT[4] - key) < abs(smallest - key))smallest = powT[4];if (abs(powT[3] - key) < abs(smallest - key))smallest = powT[3];if (abs(powT[2] - key) < abs(smallest - key))smallest = powT[2];if (abs(powT[1] - key) < abs(smallest - key))smallest = powT[1];if (abs(powT[0] - key) < abs(smallest - key))smallest = powT[0];return smallest;}int getDistance(int result, int test){int distance;distance = abs(result) - test;return abs(distance);}void recursiveSolution(int result, int runningTotal){int closest, total = runningTotal;closest = getClosest(getDistance(result, total));if (total == 0){cout { w.WriteLine(Va + " = 0" + " !! SET FOO"); w.WriteLine(Vb + " = 0" + " !! SET BAR"); w.WriteLine(Vc + " = 0" + " !! SET BAZ"); if (PostProcess.IsSpecial){ w.WriteLine(Vc + " = 20" + " !! INCREASE BAZ"); } w.WriteLine(Vd + " = 0" + " !! SET QUUX");}if (Process.UsesFirstPass) WriteVars(V1, V2, V3, V4);if (Process.UsesSecondPass) WriteVars(V5, V6, V7, V8);if (Process.UsesFinalPass) WriteVars(V9, V10, V11, V12);My main questions:Is this a proper use of inner functions?Is this acceptable when I'm the only CS graduate on a team of mostly mechanical engineers?

8752I'm new to the functional programming concepts in C#, but I have some experience with higher order functions via Haskell, Scala, Python and Ruby. I'm currently going through an old .NET 2.0 codebase with a LOT of duplication in it. Most of it is simple "copy/paste" with a few variables changed. I'm trying to condense as much of this as possible.A chunk of code within a routine I'm working on now goes a bit like this, for example:if (PostProcess.UsesFirstPass){ w.WriteLine(V1 + " = 0" + " !! SET FOO"); w.WriteLine(V2 + " = 0" + " !! SET BAR"); w.WriteLine(V3 + " = 0" + " !! SET BAZ"); if (PostProcess.IsSpecial){ w.WriteLine(V3 + " = 20" + " !! INCREASE BAZ"); } w.WriteLine(V4 + " = 0" + " !! SET QUUX");}if (PostProcess.UsesSecondPass){ w.WriteLine(V5 + " = 0" + " !! SET FOO"); w.WriteLine(V6 + " = 0" + " !! SET BAR"); w.WriteLine(V7 + " = 0" + " !! SET BAZ"); if (PostProcess.IsSpecial){ w.WriteLine(V7 + " = 20" + " !! INCREASE BAZ"); } w.WriteLine(V8 + " = 0" + " !! SET QUUX");}if (PostProcess.UsesFinalPass){ w.WriteLine(V9 + " = 0" + " !! SET FOO"); w.WriteLine(V10 + " = 0" + " !! SET BAR"); w.WriteLine(V11 + " = 0" + " !! SET BAZ"); if (PostProcess.IsSpecial){ w.WriteLine(V11 + " = 20" + " !! INCREASE BAZ"); } w.WriteLine(V12 + " = 0" + " !! SET QUUX");}Where any of the "V"s you see in there is a string variable defined earlier. It's part of a fairly large method. I could write another method called, say, WriteVariables() and pass in the required info and call it three times, but it only ever applies to this section of method. I think this would be a place where writing an anonymous inner function would make sense.I did it to test it out, and it seems to work fine. Now I have a single delegate that looks something like:private delegate void WriteCutVars(string V1, string V2, string V3, string V4, CuttingParameters cutParam);// snip //WriteCutVars WriteVars = (Va, Vb, Vc, Vd) => { w.WriteLine(Va + " = 0" + " !! SET FOO"); w.WriteLine(Vb + " = 0" + " !! SET BAR"); w.WriteLine(Vc + " = 0" + " !! SET BAZ"); if (PostProcess.IsSpecial){ w.WriteLine(Vc + " = 20" + " !! INCREASE BAZ"); } w.WriteLine(Vd + " = 0" + " !! SET QUUX");}if (Process.UsesFirstPass) WriteVars(V1, V2, V3, V4);if (Process.UsesSecondPass) WriteVars(V5, V6, V7, V8);if (Process.UsesFinalPass) WriteVars(V9, V10, V11, V12);My main questions:Is this a proper use of inner functions?Is this acceptable when I'm the only CS graduate on a team of mostly mechanical engineers?

8753[m,M]minmax(A) The input is a matrix A, the output is the minimum value m, and the maximum value M. Use nested loops to visite each element of A.b) Amatcreator(f,m,n) The input is the function handle f of a function of two variables.The output is an mxn matrix A with A(i,j)f(i,j) where m,n are input variables.Create the 5x5 Hilbert matrix by defining f(i,j)1/(ij-1) and then applying yourmatcreator(f,5,5)

8754I'm looking for the most efficient / standard way of passing data between client-side Javascript code and C# code behind an ASP.NET application. I've been using the following methods to achieve this but they all feel a bit of a fudge.To pass data from Javascript to the C# code is by setting hidden ASP variables and triggering a postback:

function SetDataField(data) { document.getElementById('').value = data;}Then in the C# code I collect the list:protected void GetData(object sender, EventArgs e){ var _list = RandomList.value;}Going back the other way I often use either ScriptManager to register a function and pass it data during Page_Load:ScriptManager.RegisterStartupScript(this.GetType(), "Set","get("Test();",true);or I add attributes to controls before a post back or during the initialization or pre-rendering stages:Btn.Attributes.Add("onclick", "DisplayMessage("Hello");");These methods have served me well and do the job, but they just dont feel complete. Is there a more standard way of passing data between client side Javascript and C# backend code?Ive seen some posts like this one that describe HtmlElement class; is this something I should look into?

8755I'm learning big O notation and am slightly confused. What is the runtime of the following code? Please explain how you solved it.Ans = 1;while( N > 0 ){Ans = Ans*2;N = N/2;}

8756I'm having an issue with my decomposition code, I need some help. My code is supposed to do a few things: Use only powers of 3, and only use each value once, and find a solution for any value from -121 to 121 (adding or subtracting) through decomposition. This code I wrote has two issues: It will reuse some values more than once, and it keeps putting an extra one at the end (E.G: 13 = 9 + 3 + 11 instead of 9 + 3 + 1). Without rewriting my code, could I get some help at just adjusting it? Adding/deleting functions, etc. is acceptable.#include #include #include #include using namespace std;const int SIZE = 5;const int pThree[SIZE] = {1, 3, 9, 27, 81};int getClosest(int key){int smallest = pThree[4];int answer = pThree[0];if(abs(pThree[4] - key) < abs(smallest-key)) smallest = pThree[4]; if(abs(pThree[3] - key) < abs(smallest-key)) smallest = pThree[3]; if(abs(pThree[2] - key) < abs(smallest-key)) smallest = pThree[2]; if(abs(pThree[1] - key) < abs(smallest-key)) smallest = pThree[1]; if(abs(pThree[0] - key) < abs(smallest-key)) smallest = pThree[0]; return smallest;}int getDistance(int result, int test){int distance;distance = abs(result) - test;return abs(distance);}void recursiveSolution(int result, int runningTotal){int closest, total = runningTotal;closest = getClosest( getDistance(result, total)); if(total == 0) { cout 0)returntrue;elseif(face.compareTo(c.face) == 0 && suit.compareTo(c.suit) >= 0)returntrue;elsereturnfalse;}}// the second d classpublicclassDeck {privateRandom random;privatefinalintNUMBER_OF_CARDS = 52;privateCard[] cards;privateSuit[] suits;privateCard[] faces;privateintindex;publicDeck(){suits = Suit.values();faces = Value.values();index = 0;cards =newCard[NUMBER_OF_CARDS];for(CardSuit s : suits){for(CardValue f: faces){cards[index] =newCard(s, f);index++;}}random =newRandom();}publicCard draw(){ints = random.nextInt(suits.length);intf = random.nextInt(faces.length);Card card =newCard(suits[s], faces[f]);returncard;}}//////////////////////peac determine the low value of cardprivate Suit suit;private Value face;

public PeaceCard(Suit aSuit, Value aFace){ //suit = aSuit;//face = aFace; super (aSuit, aFace);

boolean winner(PeaceCard c) {

if(face.compareTo(c.face) > 0) return; else if(face.compareTo(c.face) == 0 && suit.compareTo(c.suit) >= 0) return; else return;} }}// the deck peacpublic class PeaceDeck extends Deck { PeaceCard[][] deckOfCard= new PeaceCard[14][5];//1~13,1~4public PeaceDeck() {for(int i=1;ileft_ ) > height( subtree->right_ ) ) { return height( subtree->left_ ) + 1; } else { return height( subtree->right_ ) + 1; }}I only know that for the same size whether the tree is balanced or not heavily effect the time complexity of that code. So what are the recurrence relations of the code when it is balanced and not balanced ? And how to make it better ?

8799A logic function is given by the following truth tableABCDY

000001

100010

200101

300110

401000

501010

601100

701110

810001

910011

1010101

1110111

1211000

1311010

1411101

1511110

Table 6.2.1: Truth table of Part II logic function1. Derive the canonical sum-of-products (SOP) expression of the function Y(A, B, C, D)from Table 6.2.1.2. Use the Karnaugh map method to reduce this canonical SOP expression to the simplest SOP form.3. Draw the logic diagram of the SOP minimised circuit4. Use the De MorganA????1s theorems to express the simplest SOP in terms of NAND operators.5. Use the Karnaugh map method to find the simplest product-of-sums (POS) expression of the function Y(A, B, C, D).6. Draw the logic diagram of the circuit that implements the POS minimized expression. Analyze the circuit that implements the POS minimized expression and determine its truth table.NOTE: I fully intend to award more points to this question by posting a blank question and allocating the points to the person with the best answer to this question. Please provide detailed solutions,answers and diagrams( not just explanations).

8800Local birdwatchers need your help; they want a list of local birds observed, but no duplicates. Ask for a bird name; if the bird is not in the bird_names list, append it to the list. If it is already in the list, do not append it. Instead, print something like "Already in the list." When you finish collecting the data, print each bird species in the bird_names listThis is using Python (3.4.0) [Idle]

8801I'll use C# to design the model to be persistedLet's suppose I have the following entity:public class Episode { public int Id { get; set; } public string Title { get; set; } public string Image { get; set; }}This a very simple entity, which is easy to map to a relational model.But, what about if I want my Episode entity to have one or more images?How would I represent this?I can, for example create this entity model:public class Episode { public int Id { get; set; } public string Title { get; set; } public ICollection Images { get; set; }}But this, does not assure I have at least one image in my collection.Furthermore, how would I design the relational model for this entity? How can I represent an entity that has a "1 to many" relationship with a string?Do I need to create an additional table just for storing these "strings"?I would really appreciate any advice you may want to share, and the best approach to this problem

8802The Little Parking GarageA parking garage has 5 customers daily. The garage charges a $5.00 minimum fee to park up to two hours. The garage charges an additional $1.00 per hour for each hour (or part of an hour) over two hours. The maximum charge for any given day is $12.00. All cars are gone by midnight. Write a program to calculate and print a summary of the charges for a day. For input the program will read the hours of usage for each of the 5 cars. The program will print the results in the form of a table in a neat format, as shown below.Enter the hours parked for car 1:1.5Enter the hours parked for car 2:4.1Enter the hours parked for car 3:12.0Enter the hours parked for car 4:9.3Enter the hours parked for car 5:0.5Total Hours 27.4Total Charge $42.00Use one decimal place for the hours parked, and 2 for the total charge. Name this programParkingGarage.cppNOTE: The program standards are given below:1. Program Header .In addition to you name and project number, include a brief description of the program functionality in the header comment for the program2. Variables and Constants. All variables and constants in a program must be declared at the beginning of the program3. Initialization. Variables may not be initialized in their declaration.4. Printing ofif-then. Use one of the following if (expression) statement if (expression) Single-statement if (expression) { Multiple-statements }5. Printing ofif-then-else. Use one of the following if (expression) statement else statement if (expression) Single-statement else Single-statement if (expression) { Multiple-statements } else { Multiple-statements }6. Printing ofwhileloops. Use one of the following while (expression) statement while (expression) Single-statement while (expression) { Multiple-statements }7. For loops.The bodies of all for-loops must be indented at least 3 (but no more than 5) spaces: for(int i = 0; i < n; i++) { cout num; if (num < 0) num_neg++; else if (num > 0) num_pos++; else num_zero++; }8. Methods. The bodies of all functions must be indented at least 3 (but no more than 5) spaces:double CircleArea(double r) { const double Pi = 3.1415; return Pi * r * r; }

8803There is a list of 9999 integers that are randomly generated in the range of [1,9999]. Each integer occupies one single line and takes 4 characters' space per line. Alternatively, you can think that each number takes 5 characters' space, four for the number and one for the newline character. Write a C++ program using the seekg() and seekp() functions to insert the numbers 7777 through 7781 between the 6000-th and 6001-st numbers of the input file. Below are a few useful tips:The tellg() and tellp() functions return the position of the current character in an input stream or output stream, respectively.You are strongly recommended to use the tellg() function to first learn about the starting position of each integer. This will help you locate the exact starting position to insert the new numbers.You can use the width() function to specify the number of characters you'd like an integer to occupy.In addition to the "output" operator ( 3.6The answer for this question can be found in fileDOT-PRODUCT.LSPin the same directory. The key for designing a lisp function is using recursion.B). Write a function COUNT-NUMBER that counts the number of numbers that occur in a list. It should work like this:-> (COUNT-NUMBER '(A 2.3 B 5 4.53 C F))-> 3Hint: To determine whether s-expression is a number or not, usenumberpfunction. The following examples show hownumberpworks:-> (numberp 5)-> T-> (numberp 5.5)-> T-> (numberp T)-> nil-> (numberp A????1(A B))-> nil

8805Linux Vi HelpCreate a file in Vi and write the steps you would take to complete the last five steps. NOTE: You do not have to create individual files, simply write what you would type out.Step 16.Create a listing of all words that Linux knows of that contains the word "dog", and save it as dog_doodoo.

Step 17.Create a file from dog_doodoo that only shows the words that contain the word "dogs" sorted in reverse order and saved as detros_sgod, which is dogs_sorted backwards.

Step 18.Create a file called flat_cat that shows the count of all words that Linux knows of with the word cat in them.

Step 19.Create a script called my_details containing your user name, login name, shell being used, and home directory.

Step 20.Create a script that does the following called my_scriptDisplays everyone logged inPauses for 2 secondsDisplays a listing of the directory in long formPauses for 2 secondsDisplays today's datePauses for 1 secondDisplays a calendar from Sept. 1752 onlyPauses for 2 secondsAsks the user how they are doing todayDisplays Goodbye

8806Linux/Unix Problem --- Type out answers to steps 16 through 20Step 16.Create a listing of all words that Linux knows of that contains the word "dog", and save it as dog_doodoo.

Step 17.Create a file from dog_doodoo that only shows the words that contain the word "dogs" sorted in reverse order and saved as detros_sgod, which is dogs_sorted backwards.

Step 18.Create a file called flat_cat that shows the count of all words that Linux knows of with the word cat in them.

Step 19.Create a script called my_details containing your user name, login name, shell being used, and home directory.

Step 20.Create a script that does the following called my_scriptDisplays everyone logged inPauses for 2 secondsDisplays a listing of the directory in long formPauses for 2 secondsDisplays today's datePauses for 1 secondDisplays a calendar from Sept. 1752 onlyPauses for 2 secondsAsks the user how they are doing todayDisplays Goodbye

8807In Linux shell script, write a script thatasks user for a name of a file that existssee if file existsif file exists, ask user if they would like to delete or move fileif the user selects "delete" then delete fileif user selects "move" then ask user for what directory they would like to move it to and move it thereelse if file does not exist then exit

8808As a Linux (server side) developer, I don't know where and why should I use C++.When I'm going for performance, the first and last choice is C.When "performance" isn't the main issue, programming languages like Perl and Python would be good choices.Almost all open source applications I know in this area have been written in C, Perl, Python, Bash script, AWK or even PHP, but no one uses C++.I'm not discussing other areas like GUI or web applications, I'm just talking about Linux, CLI and daemons.Is there any satisfactory reason to use C++?

8809link shape color to cell value:I would like the color of a shape (for example a circle) to be linked to a cell value in A1.The shapes name is CIRCLE1For example if 1 is in A1, the shape is red, 2 will give blue and 3 will give white.Can anyone help??

8810Link Cell To Values On Different SheetGreetings,Can anyone help me with a formula that would auto-populate the details from sheet 2 on sheet 1 once I enter the category? I plan to do some learning about formulas and functions this weekend but was hoping for this help for now.Sheet 1:ItemCategoryDetail

1Aautofill from Sheet 2

2Bautofill from Sheet 2

3Aautofill from Sheet 2

Sheet 2:Category ADetail

Category BDetail

Thank You !!

8811A linear time-invariant continuous-time system has the impulse response below:h(t) =[cos 2t + 4 sin 2t]u(t)Plot the system impulse response using Matlab.Please provide all MATLAB codeing

8812I have a line a character counter, i'm having trouble with a word counter. I want to use char c to find when the previous char is white space and then know when a string of charcters is white space again. and every time that happens, i want the value variable for words county, to increase by one.here's my code so far#include int main(int argc, char *argv[]){

printf("filename is: %s\n", argv[1]); FILE * fin; fin = fopen(argv[1],"r"); char c; int count =0; int countx = 0; int county =0; c=fgetc(fin); while (c!=EOF) { // counting lines if(c== '\n') { count = count +1; } //counting characters if