Questions
in c++ please follow instructions and fix the errors and please make a comment next to...

in c++ please follow instructions and fix the errors and please make a comment next to each code error you fix.

  • Below are 25 code fragments, inserted into a try catch block.
  • Each line has zero or more errors. Your task is to find and remove all errors in each fragment.
    • Do not fix problems by simply deleting a statement; repair the problems by changing, adding, or deleting a few characters.
    • There may be different ways to fix them
    • You may need to rename variables to avoid re-declaration errors
    • When you fix a line, it should print out "Success!" and then a newline.
  • You may want to comment out each line that you have not fixed yet in order to get it to compile, so you can test as you go
  • In the end you should see a total of 25 "Success!" outputs

#include "std_lib_facilities.h"
int main()
try
{
//1.
Cout << "Success!\n";
//2.
cout << "Success!\n;
//3.
cout << "Success" << !\n"
//4.
cout << success << '\n';
//5.
string res = 7; vector<int> v(10); v[5] = res; cout << "Success!\n";
//6.
vector<int> v(10); v(5) = 7; if (v(5)!=7) cout << "Success!\n";
//7.
if (cond) cout << "Success!\n"; else cout << "Fail!\n";
//8.
bool c = false; if (c) cout << "Success!\n"; else cout << "Fail!\n";
//9.
string s = "ape"; boo c = "fool"<s; if (c) cout << "Success!\n";
//10.
string s = "ape"; if (s=="fool") cout << "Success!\n";
//11.
string s = "ape"; if (s=="fool") cout < "Success!\n";
//12.
string s = "ape"; if (s+"fool") cout < "Success!\n";
//13.
vector<char> v(5); for (int i=0; 0<v.size(); ++i) ; cout << "Success!\n";
//14.
vector<char> v(5); for (int i=0; i<=v.size(); ++i) ; cout << "Success!\n";
//15.
string s = "Success!\n"; for (int i=0; i<6; ++i) cout << s[i];
//16.
if (true) then cout << "Success!\n"; else cout << "Fail!\n";
//17.
int x = 2000; char c = x; if (c==2000) cout << "Success!\n";
//18.
string s = "Success!\n"; for (int i=0; i<10; ++i) cout << s[i];
//19.
vector v(5); for (int i=0; i<=v.size(); ++i) ; cout << "Success!\n";
//20.
int i=0; int j = 9; while (i<10) ++j; if (j<i) cout << "Success!\n";
//21.
int x = 2; double d = 5/(x–2); if (d==2*x+0.5) cout << "Success!\n";
//22.
string<char> s = "Success!\n"; for (int i=0; i<=10; ++i) cout << s[i];
//23.
int i=0; while (i<10) ++j; if (j<i) cout << "Success!\n";
//24.
int x = 4; double d = 5/(x–2); if (d=2*x+0.5) cout << "Success!\n";
//25.
cin << "Success!\n";


keep_window_open();
return 0;
}
catch (exception& e)
{
cerr << "error: " << e.what() << '\n';
keep_window_open();
return 1;
}
catch (...)
{
cerr << "Oops: unknown exception!\n";
keep_window_open();
return 2;
}

In: Computer Science

If the items in a list are floats taking 8 memory locations each, compare the amount...

If the items in a list are floats taking 8 memory locations each, compare the amount of space required altogether if (a) the list is kept contiguously in an array 80 percent full (b) the list is kept contiguously in an array 60 percent full and (c) the list is kept as a linked list where the pointers take two memory locations each

In: Computer Science

Create a Linked List and conduct the following operations. Portion of the program is given. The...

Create a Linked List and conduct the following operations. Portion of the program is given.

The operations are:

  1. Add an “H” to the list
  2. Add an “I” to the list
  3. Add 100 to the list
  4. Print the content of the list and its size
  5. Add a “H” to the first place of the list
  6. Add a “R” to the last place of the list
  7. Get the element of position 3 and print it
  8. Get the last element and print it
  9. Add an “U” to the list
  10. Add a “?” to the list
  11. Remove the element of position 5
  12. Get and print the element of position 5
  13. Remove the element of first place and print the element
  14. Print the content of the list and its size

Partial program is:

import java.util.*;

public class LinkedListDemo{

public static void main(String[] args){

    LinkedList link=new LinkedList();

    link.add(" "); //add something here

    link.add(" "); //add something here

    link.add(new Integer( )); //add something here

    System.out.println("The contents of array is" + link);

    System.out.println("The size of an linkedlist is" + link.size());

   

//add your code

//end your code

}

}

MAKE SURE TO ATTACH THE SCREENSHOT OF THE RUNNING RESULT

In: Computer Science

hi i need a code that will give me this output, For the multiply_list, the user...

hi i need a code that will give me this output,

For the multiply_list, the user will be asked to input the length of the list, then to input each element of the list.

For the repeat_tuple, the user is only asked to enter the repetition factor, but not the tuple. Your program should take the list created before and convert it to a tuple.

output expected: (**user input**)

******Create your List ******

Enter length of your list: 3

****** Start filling your List ******

Enter element 1: 2

Enter element 2: 3

Enter element 3: 4

Result of list multiplication: 24

*** Create a tuple and repeat it

Enter your repetition factor: 2

Repeated Tuple: (2, 3, 4, 2, 3, 4)

this is what i have so far:

print("\n********* Create Your List ********")


len_list = int(input("Enter length of your list: "))
print("\n********* Start filling your list ********")


if len_list > 0:
    element = int(input("Enter element {0}: ".format(len_list)))

In: Computer Science

Write a Python program that calls a function to sum all the numbers in a list...

Write a Python program that calls a function to sum all the numbers in a list and returns the result to the caller. The main program creates a list (with hard-coded or user input) and passes the list as an argument to the function. You may not use the built-in function, sum.

The program calls a second function to multiply all the numbers in a list passed to it by main and returns the product back to the caller.

List can be created with user input or hard-coded elements.

The program calls a third function that takes the list of words (below) passed to it from main and determines which elements are palindromes without changing the original list.

['racecar', 'Python', 'mom', 'java','level', 'DNA','101101' ]

If true, the function appends the word to a new list and returns it to the caller. The main program prints the list of palindromes returned from the function. The function should not modify the original list passed to it from the main (no side effect).

A palindrome is a word, phrase, number or sequence of words that reads the same backward as forward

In: Computer Science

Develop a C++ "doubly" linked list class of your own that can hold a series of...

Develop a C++ "doubly" linked list class of your own that can hold a series of signed shorts

Develop the following functionality:

  • Develop a linked list node struct/class
    • You can use it as a subclass like in the book (Class contained inside a class)
    • You can use it as its own separate class
    • Your choice
  • Maintain a private pointer to a node class pointer (head)
  • Constructor
    • Initialize head pointer to null
  • Destructor
    • Make sure to properly delete every node in your linked list
  • push_front(value)
    • Insert the value at the front of the linked list
  • pop_front()
    • Remove the node at the front of the linked list
    • If empty, this is a no operation
  • operator <<
    • Display the contents of the linked list just like you would print a character string
  • operator []
    • Treat like an array
    • Return the value stored in that element of the linked list
    • If element doesn’t exist, return std::numeric_limits<short>::min()
  • empty()
    • Returns a boolean that determines if the linked list is empty or not
  • size()
    • Returns how many elements are currently in the linked list
    • You may not use a variable to maintain the size
    • You must calculate it manually using pointers
  • insert(positionIndex, value)
    • Think vector indexing
    • positionIndex of 0 means insert at the beginning of the linked list
    • positionIndex >= linked list size gets inserted at the back of the linked list
  • erase(positionIndex)
    • Think vector indexing
    • positionIndex of 0 means insert at the beginning of the linked list
    • positionIndex >= linked list size is a no operation
  • find(value)
    • Searches the linked list for the given value
    • Think vector indexing
    • If found, returns the index value it is at
    • If not found, returns -1

In: Computer Science

Number Analysis Program (Specific Design Specifications) Design a Python program that asks the user to enter...

Number Analysis Program (Specific Design Specifications)

Design a Python program that asks the user to enter a series of 20 numbers. The program should store the numbers in a list then display the following data: The lowest number in the list The highest number in the list The total of the numbers in the list The average of the numbers in the list

This python program must include the following functions. Your program must use the exact names, parameter lists, and follow the function descriptions provided.

def CreateNumberList(howMany): This function will accept a parameter for how many numbers to include in a list. It will create a list containing howMany elements that are random numbers in the range 1 - 500. The function return value will be the list that contains these values.

def SortList(myList): This function will accept the list of random numbers as the parameter variable. It will first use the sort() function to sort the values in the list. Then this function will use index 0 and index len(myList) - 1 to print the smallest and largest value in the list. This function does not have a return value.

def DisplayAverage(myList): This function will accept the list of random numbers as the parameter variable. If will use a for loop to iterate through each item in the list and add each value to a sum variable. You will then calculate the average of the values and display the average as the output. This function does not have a return value.

def main(): This function will begin by asking the user how many numbers they want to generate in their list. You must include an input validation loop that will not accept a number less than 1. After the input is validated, call the CreateNumberList function and store the return value in a variable, then call the SortList and DisplayAverage functions passing your list as an argument. Call your main function to execute the program.

In: Computer Science

Convert the following code from awk to Perl: (please don't use a2p (awk to perl) command)...

Convert the following code from awk to Perl: (please don't use a2p (awk to perl) command)

Here was the original problem:

Calculate the grade for each student that appears in the data file. You may calculate the grade based on total earned points, divided by total possible points. Or, for 10 points extra credit; Use the weighted totals for this course; available in the syllabus and on the course home page.

Output a list of students, their grade as a percentage and a letter grade. For simplicity; use this letter grade scale;

  • A = 90 >= grade <= 100
  • B = 80 >= grade < 90
  • C = 70 >= grade < 80
  • D = 60 >= grade < 70
  • E = grade < 60

The following sample output has been provided as a guide. Your solution must be based on the data in the Lab03-data.csv file. No points will be awarded to solutions that are based on copy-pasting the sample output and printing it with awk.

Name    Percent Letter
Andrew  75.21   C
Chelsey 92.21   A
Shane   77.64   C
Ava     79.76   C
Sam     62.34   D

Here is some of the sample data from the file (Lab03-data.csv)

Student Catehory Assignment Score Possible
Sam Quiz Q07 68 100
Sam Final FINAL 58 100
Sam Survey WS 5 5
Andrew Homework H01 25

100

Here is the AWK code that needs to be converted to PERL

BEGIN{
FS = ","
print "Name\tPercent\tLetter"
a=0
}

{

if(a==0){
   a+=1
}

else{
   sum[$1$2] += $4
   total[$1$2] += $5
   students[$1]++
   categories[$2]++

}
}

END{

#for(b in sum)
#   percent=(sum[b]/total[b])*100
for (b in students){
    Homework=(sum[b"Homework"]/total[b"Homework"])*0.10
        Lab=(sum[b"Lab"]/total[b"Lab"])*.30
        Final=(sum[b"Final"]/total[b"Final"])*.15
        Quiz=(sum[b"Quiz"]/total[b"Quiz"])*.40
        Survery=(sum[b"Survey"]/total[b"Survey"])*.05
        percent=(Homework+Lab+Final+Quiz+Survery)*100
   printf "%s\t%.2f\t",b,percent
   if(percent>=90 && percent<=100)
       print "A";

   else if(percent>=80 && percent<90)
       print "B";

   else if(percent>=70 && percent<80)
       print "C";

   else if(percent>=60 && percent<70)
       print "D";

   else
       print "E"

}
}

In: Computer Science

Your assignment consists of different question styles including discussion questions, reports, exercises, problem questions and spreadsheet...

Your assignment consists of different question styles including discussion questions, reports, exercises, problem questions and spreadsheet questions. It assesses learning outcomes as listed in the assignment rationale below.

The purpose of this assignment is to continue to develop skills in costing systems with an emphasis on the role of control in managing the production of goods and services efficiently in the workplace. Each question builds on the knowledge gained through the first assignment to develop the concepts of management accounting control through costing. Each question uses realistic data and professional practices similar to that found in workplaces.

Question 1: Budget (20 marks in total)

Resort Island University is preparing its budget for the upcoming academic year. This is a specialised private university that charges fees for all degree courses. Currently, 15,000 students are enrolled on campus. However, the university is forecasting a 5 % growth in student numbers in the coming year, despite an increase in fees of $3,500 per subject. The following additional information has been gathered from an examination of the university records and conversations with university managers:

  • Resort Island is planning to award scholarships to 150 students, which will cover their fees.
  • The average class has 80 students, and the typical student takes 4 subjects per semester. Resort Island operates 2 semesters per year.
  • The average academic staff salary is $120,000 per annum including on-costs.
  • Resort Island's academic staff are evaluated on the basis of teaching, research administration and professional/community service. Each of the academic staff teaches the equivalent of three subjects during the academic year.

Required:

  1. Prepare a revenue budget for the upcoming academic year
  2. Determine the number of staff needed to cover classes.
  3. Assume there is a shortage of full-time academic staff. List at least five actions that Resort Island might take to accommodate the growing student numbers.
  4. You have been requested by the university's deputy vice chancellor (DVC) to construct budgets for other areas of operation (such as library, grounds, cafeteria, and maintenance). The DVC noted: 'The most important resource of the university is academic staff. Now that you know the number of staff needed, you can prepare the other budgets. Academic staff are indeed the key driver - without them we don't operate.' Does the DVC really understand the linkages with the budgeting process? Explain.

In: Finance

WRITE AN APPROPRIATE CONCLUSION TO COMPLETE THE ESSAY BELOW. The world is currently faced with a...

WRITE AN APPROPRIATE CONCLUSION TO COMPLETE THE ESSAY BELOW.

The world is currently faced with a global pandemic of the novel Coronavirus disease 2019 (Covid-19) which quickly spread to many countries of the world. Measures were enforced in each country to stop the spread of the virus. One of the measures taken was the abrupt closure of all schools which led schools to explore online teaching methods to continue learning among its students. Several categories of online teaching methods were used, chosen based on the topic, the target students, the requirements of the Ministry of Education and the demands of the users. Online learning methods can mimic actual classrooms, with required attendance at specific times, can be self-paced, or blended, and use a variety of tools to engage students and support learning. Asynchronous, Synchronous and Hybrid online learning are three categories of online teaching methods.

Asynchronous online learning is one category of an online teaching method. It is used to describe types of learning and education that do not happen in the same place or time. This is important because digital and online teaching platforms allow students to access learning materials prepared by teachers at a time convenient to them. Students and teachers can interact continuously through online forums. Examples of asynchronous learning are emails, blogs, online discussion board and game-based activities. According to Keith Bachman, “in times where small instructor-led classrooms tend to be the exception, electronic learning solutions can offer more collaboration and interaction with experts and peers, as well as a higher success rather than the live alternative”.

Synchronous learning is another type of online teaching method. This is live online learning from various places with many learners. Here an instructor teaches virtually not physically. One of the most important advantages of synchronous learning is that it would provide a better classroom environment because of the variety of media used for the personal contact. Since students of this age are very tech savvy it becomes very easy for them to adopt to the classes using their own devices. Secondly, it helps the students learn at their own pace, time and distance is also not an issue. This would mean that time and space are overcome with the help of technology. Thirdly, they also have a variety of materials which would suit the learning style and speed of the learners. However, the disadvantage is that there is a rigid schedule which one cannot break or miss. This would make people more stressed if it is accompanied by technical difficulties. Nevertheless, synchronous learning has changed the face of learning amidst the pandemic.

Finally, another class of the online teaching method involves hybrid online learning. Hybrid online course includes a combination of the asynchronous and synchronous learning systems. The goal of the hybrid teaching method is to combine the best elements of online teaching and teaching traditionally to give the best experience of learning. Students would be required to meet face to face and have classes online, due to the CoronaVirus disease persons will be assigned by the Lecturer to meet in small groups and a face to face class will be given on a specific day. According to PennState, research and effective practice has shown that this teaching method gives students the opportunity to learn class work before and after it was taught, leaving powerpoint presentations and providing readings online can ensure this.(PennState University, n.d)Students who don't understand what was taught in class can go back and look at previous which is a major help. This method is flexible and allows both students and teachers to balance their work, social life and other activities a lot better.

In: Psychology