Blog

Coursehelp
February 6, 2019
QUESTION : No Comments

One of the disadvantages of proprietary software is that:

One of the disadvantages of proprietary software is that:

Question 48 options:

it is hard to control results even if one is involved in the development of software.
it can take a long time and significant resources to develop the required software features.
it does not allow modification of features
that one might need to counteract an initiative by competitors.
it is difficult to achieve what is required in terms of features and reports.

Expert Answer

In my opinion, the second option is the most relevant.

OR
OR

Have a Comment on this Question?

Questions viewed by other students


  • QUESTION : (Solved) : Code Previous Exercise Let Know Need Question Code Include Include Include Include Include Q30110728 . . .

    //This was code from a previousexercise – let me know if you need the question for this code.

    #include<iostream>

    #include<fstream>

    #include<vector>

    #include<string>

    #include<cstdlib>

    #include<cstring>

    using namespace std;

    class InventoryItem{

    private:

    string description;

    int quantityOnHand;

    double price;

    public:

    InventoryItem()

    {

    description=”NULL”;

    quantityOnHand=0;

    price=0;

    }

    InventoryItem(string desc, int q, double p)

    {

    description=desc;

    quantityOnHand=q;

    price=p;

    }

    string getDescription()

    {

    return description;

    }

    int getQuantityOnHand()

    {

    return quantityOnHand;

    }

    double getPrice()

    {

    return price;

    }

    void setDescription(string d)

    {

    this->description=d;

    }

    void setPrice(double p)

    {

    this->price=p;

    }

    void setQuantityOnHand(int q)

    {

    this->quantityOnHand=q;

    }

    void display()

    {

    cout<<“Description:”<<description<<endl<<“Quantity:”<<quantityOnHand<<endl<<“Price:”<<price<<endl;

    }

    void read(ifstream &inFile)

    {

    string line;

    getline(inFile, line, ‘,’);

    setDescription(line);

    int q; double p; char comma;

    inFile >> q;

    setQuantityOnHand(q);

    inFile >> comma;

    inFile >> p;

    setPrice(p);

    inFile.ignore(100, ‘n’);

    }

    };

    int main()

    {

    ifstream input;

    input.open(“inventory.txt”);

    vector<InventoryItem> inventory;

    while(!input.eof())

    {

    InventoryItem item;

    item.read(input);

    inventory.push_back(item);

    }

    //print the data

    for(int i=0; i<inventory.size(); i++)

    {

    inventory.at(i).display();

    cout<<endl<<endl;

    }

    cin.get();

    return 0;

    }

    //This was the task before theexercise 1 that I need.

    Exerise 1.Declare a classBook as a derived class of InventoryItem. You only need to do theclass specification in this task. Write a specification in a headerfile called Book.h. Make sure to include InventoryItem.h file fromTask 1.

    Exerise 2.class Book shouldhave the following data members:

    Title

    Name of author (assume only one author for now)

    Publisher

    Exerise 3.Write theprototypes of the following member functions in class Book

    A default constructor that initializes the above data members todefault values of your choice and uses the default constructor ofthe base class

    Accessor and mutator functions for book title, author, andpublisher

    A parametrized constructor that initializes all data membersincluding description, price, and quantity on hand. Remember to useas much of the code from the base class and to use the setfunctions to set data members.

    A member function display to display all attributes of abook

    A member function read to read all attributes of a book from aninput stream.

    Task 3: Incremental implementation and testing

    Exercise 1.Write a stub for eachmember function of class Book. You can this either in Book.h or ina separate implementation file (Book.cpp). A function stub consistsof the function header and an empty body if the function is a voidfunction. For value-returning functions, have the function return adummy value.

    Exercise 2.Write a driver program totest your new class. In function main() of the driver program,declare one instance of class Book. Build your project and fix allsyntax errors.

    Exercise 3.Incrementally implement themember functions of class Book. Each time you implement a functiontest it. Start with the set functions, then implement the getfunctions. Use the get function to test the set functions. Thenimplement and test the constructors. Finally, implement and testthe display and read member functions.

    When implementing your class, you need to adhere to thefollowing practices:

    Use code from the base class wheneverpossible

    Any changes to the data members should be done using theclass mutator functions.

    //This is the part needed

    Exercise 1.Use the driverprogram below to test your Book class. Make sure to include theheader file with the Book class you defined in the previous tasks.Create a sample input file with two or three book records fortesting purpose.

    //*******************************************************

    // Driver program to test classBook.

    // Note that it uses the vector classfrom the Standard Template Library

    // to create a dynamic list of Bookinstances

    #include include

    #include

    #include

    #include

    #include “Book.h”

    using namespace std;

    int main()

    {

      

          ifstream file(“data.csv”);   //Assume the name of inputfile is “data.csv”

          if (!file)

    {

                 cerr <<“Can’t open file “<< “data.csv”<

                 return(EXIT_FAILURE);

          }

          

          vector bookList;

          Book temp;

          while (file)

          {

                 temp.read(file);

                 bookList.push_back(temp);

          }

          for (int i = 0; i < bookList.size(); ++i)

                 bookList[i].display();

       system(“pause”);

       return 0;

    }

    1. Submit a copy of your input file (text format)

    2. Submit a copy of your class definitions and test program(text format)

    3. Submit a screenshot of your program execution

    *Please let me know if more info is needed this is form aexercise with multiple tasks

    Expert Answer


    . . .


    view full answer
  • QUESTION : (Solved) : Code Predicate Shuffle 3 Shffles Two Given Lists Third E Interleaves Way Resulting List Co Q27893155 . . .

    Programming language : Prolog

    Not allowed to use pre-defined predicates!

    Code a predicate shuffle/3 that shffles the two given lists into a third, i.e., interleaves them in some way: the resulting list contains all elements of both given lists and only those, in their order of appearance in the given lists, but interleaved arbitrarily. The predicate must be able to accept and generate all valid outcomes of shuffling 2- shuffle([1,2,3,4], [a,b,c], [1 ,a , b ,2 , 3 , c ,4] ). true ?- shuffle([1], [a,b],Zs). false (The order in which answers are generated is not important.)

    Code a predicate shuffle/3 that shffles the two given lists into a third, i.e., interleaves them in some way: the resulting list contains all elements of both given lists and only those, in their order of appearance in the given lists, but interleaved arbitrarily. The predicate must be able to accept and generate all valid outcomes of shuffling 2- shuffle([1,2,3,4], [a,b,c], [1 ,a , b ,2 , 3 , c ,4] ). true ?- shuffle([1], [a,b],Zs). false (The order in which answers are generated is not important.) Show transcribed image text

    Expert Answer


    . . .


    view full answer
  • QUESTION : (Solved) : Code Public Class Arraysorter Insertion Sort Public Static Void Insertionsort T Int N Inse Q32239286 . . .

    The Algorithm 8.23 The heart of the Shell sort is the adaptation of the insertion sort to work on a subarray of equally spaced entries. By combining and modifying the two algorithms that describe the insertion sort, as given in Segment 8.10, we obtain the following algorithm that sorts array entries whose indices are separated by an increment of space Algorithm incrementalInsertionSort(a, first, last, space) Sorts equally spaced entries of an array a [first..1ast] into ascending order // first >= 0 and < a.length; last >= first and < a.length; // space is the difference between the indices of the entries to sort for (unsorted-first space through last at increments of space) nextToInsert = a[unsorted] indexunsorted space while ( (index >= first) and (nextToInsert.compareTo(a[index)) < 0) ) a[index index = index + space] a[index] = space a[index space] nextToInsert A method to perform a Shell sort will invoke incrementalInsertionSort and supply any sequence of spacing factors. For example, the following algorithm uses the spacing that Segment 8.22 described: Algorithm shellSort(a, first, last) Sorts the entries of an array a first..last] into ascending order first-0 anda.Tength; 1astfirst and<a.length nnumber of array entries space n / 2 Comparing the Algorithms 263 while (space 0) for (begin-first through first+space 1) incrementalInsertionSort(a, begin, last, space) space space 2

    this is the code :

    public class ArraySorter {

    // INSERTION SORT

    public static <T extends Comparable<? super T>>

    void insertionSort(T[] a, int n) {

    insertionSort(a, 0, n – 1);

    } // end insertionSort

    public static <T extends Comparable<? super T>>

    void insertionSort(T[] a, int first, int last) {

    for (int unsorted = first + 1; unsorted <= last; unsorted++){ // Assertion: a[first] <= a[first + 1] <= … <=a[unsorted – 1]

    T firstUnsorted = a[unsorted];

    insertInOrder(firstUnsorted, a, first, unsorted – 1);

    } // end for

    } // end insertionSort

    private static <T extends Comparable<? super T>>

    void insertInOrder(T anEntry, T[] a, int begin, int end) {

    int index = end;

    while ((index >= begin) &&(anEntry.compareTo(a[index]) < 0)) {

    a[index + 1] = a[index]; // Make room

    index–;

    } // end for

    // Assertion: a[index + 1] is available

    a[index + 1] = anEntry; // Insert

    } // end insertInOrder

    // SHELL SORT

    public static <T extends Comparable<? super T>>

    void shellSort(T[] a, int n) {

    shellSort(a, 0, n – 1);

    } // end shellSort

    /**

    * Sorts equally spaced elements of an array into ascendingorder.

    *

    * @param a An array of Comparable objects.

    * @param first An integer >= 0 that is the index of the firstarray element

    * to consider.

    * @param last An integer >= first and < a.length that isthe index of the

    * last array element to consider. @param space The differencebetween the

    * indices of the

    eleme

    * nts to sort.

    */

    public static <T extends Comparable<? super T>>

    void shellSort(T[] a, int first, int last) {

    int n = last – first + 1; // Number of array entries

    int space = n / 2;

    while (space > 0) {

    for (int begin = first; begin < first + space; begin++) {

    incrementalInsertionSort(a, begin, last, space);

    } // end for

    space = space / 2;

    } // end while

    } // end shellSort

    // BETTER SHELL SORT

    /**

    * Avoids even spacing

    */

    public static <T extends Comparable<? super T>>

    void betterShellSort(T[] a, int n) {

    betterShellSort(a, 0, n – 1);

    } // end betterShellSort

    // Exercise 14, Chapter 8

    public static <T extends Comparable<? super T>>

    void betterShellSort(T[] a, int first, int last) {

    int n = last – first + 1; // Number of array elements

    for (int space = n / 2; space > 0; space = space / 2) {

    if (space % 2 == 0) // If space is even, add 1

    {

    space++;

    }

    for (int begin = first; begin < first + space; begin++) {

    incrementalInsertionSort(a, begin, last, space);

    }

    } // end for

    } // end betterShellSort

    private static <T extends Comparable<? super T>>

    void incrementalInsertionSort(T[] a, int first, int last, intspace) {

    int unsorted, index;

    for (unsorted = first + space; unsorted <= last;

    unsorted = unsorted + space) {

    T nextToInsert = a[unsorted];

    index = unsorted – space;

    while ((index >= first) &&(nextToInsert.compareTo(a[index]) < 0)) {

    a[index + space] = a[index];

    index = index – space;

    } // end while

    a[index + space] = nextToInsert;

    } // end for

    } // end incrementalInsertionSort

    } // end ArraySorter

    The Algorithm 8.23 The heart of the Shell sort is the adaptation of the insertion sort to work on a subarray of equally spaced entries. By combining and modifying the two algorithms that describe the insertion sort, as given in Segment 8.10, we obtain the following algorithm that sorts array entries whose indices are separated by an increment of space Algorithm incrementalInsertionSort(a, first, last, space) Sorts equally spaced entries of an array a [first..1ast] into ascending order // first >= 0 and = first and = first) and (nextToInsert.compareTo(a[index)) Show transcribed image text

    Expert Answer


    . . .


    view full answer
  • QUESTION : (Solved) : Code Provided Kotlin Needs Changed Object Oriented Style Instructions Provided Within Code Q31155907 . . .

    The code Provided in Kotlin, needs to be changed intoobject-oriented style. All instructions are provided within thecode as comments. Please change it accordingly.

    import java.io.File// this function wouldn’t be needed if using a collection like a// mutable list, arraylist, etc — they can dynamically grow bigger// all this function does is figure out how many lines are in the filefun filesize(): Int { val dataset = File(“src/resources/dataset.txt”).bufferedReader() var fsize = 0 while (true) { val line = dataset.readLine() if (line == null) return fsize fsize += 1 } }// this is NOT a object-oriented program – it reads// a file into three arrays so that name[i] is the // name of the person from record i of the file, // idnum[i] is the id number of that person, and // amount[i] is an amount for that person // Your goal is to rewrite or refactor this program // so that it has a minimal main program, and puts // the code into class, method, object, companion // object, etc — more Object Oriented style of programfun main(args: Array<String>) { // read the input into name, idnum, and amount arrays val n = filesize() val name = Array<String>(n,{i -> “”}) val idnum = Array<Int>(n,{i -> 0}) val amount = Array<Double>(n,{i -> 0.0}) // read the file into the arrays val dataset = File(“src/resources/dataset.txt”).bufferedReader() for (i in 0 until n) { val line = dataset.readLine() if (line == null) break val fields = line.split(“,”) name[i] = fields[0] idnum[i] = fields[1].toInt() amount[i] = fields[2].toDouble() } // make a function to print one record using the arrays fun show(indx:Int): String = “Record(${name[indx]},${idnum[indx]},${amount[indx]})” // make a function to look up a name, returning an index fun lookupName(find:String): Int { for (i in 0 until name.size) { if (find == name[i]) return i } return -1 // if name not found } // make a function to find index of maximum amount fun maxAmount(): Int { var maxamt = 0.0 var rememberIndex = 0 for (i in 0 until amount.size) { if (amount[i]>maxamt) { maxamt = amount[i] rememberIndex = i } } return rememberIndex } fun setAmount(newamt:Double,indx:Int) { amount[indx] = newamt } fun setAmount(newamt:Double,name:String) { amount[lookupName(name)] = newamt } fun setIdnum(newid:Int,index:Int) { idnum[index] = newid } fun setIdnum(newid:Int,name:String) { idnum[lookupName(name)] = newid } // here is some simple testing of these functions and the data val samplename1 = “HDQJwSQdyyFh” println(“Lookup of $samplename1 is ${show(lookupName(samplename1))} ) setIdnum(123456789,samplename1) println(“Revised Lookup of $samplename1 is ${show(lookupName(samplename1))} ) val samplename2 = name[29] println(“Lookup of $samplename2 is ${show(lookupName(samplename2))} ) setAmount(88888.88,samplename2) println(“Revised Lookup of $samplename2 is ${show(lookupName(samplename2))} ) }

    Expert Answer


    . . .


    view full answer
  • QUESTION : (Solved) : Code Provided 1 Need 2 3 4 T 4 001 4 X1 1274 Sin 2 Pi T X2 0425 Sin 6 Pi T X3 0255 Sin Q31044627 . . .

    Code is provided for #1. I need #2,#3,and #4
    t=-4:0.01:4 ;x1 = 1.274 .* sin(2.*pi.*t);x2 = 0.425 .* sin(6.*pi.*t) ;x3 = 0.255 .* sin(10.*pi.*t) ;x4 = 0.182 .* sin(14.*pi.*t) ;y = x1 + x2 + x3 + x4 ;subplot(5,1,1) ; plot(t,x1) ; axis([ 0 1 -2 2 ]) ;subplot(5,1,2) ; plot(t,x2) ; axis([ 0 1 -2 2 ]) ;subplot(5,1,3) ; plot(t,x3) ; axis([ 0 1 -2 2 ]) ;subplot(5,1,4) ; plot(t,x4) ; axis([ 0 1 -2 2 ]) ;subplot(5,1,5) ; plot(t,y ) ; axis([ 0 1 -2 2 ]) ;
    1. Write MATLAB code to generate following 2-D graphs. a. Generate a time variable from 0 to 1 [sec] in 0.001 [sec] step size b. Draw xi()- (1.274)sin(2Tt) with respect to time using MATLAB plot c. Draw x2() (0.425)sin(6Tt) with respect to time using MATLAB plot d. Draw x3(t)- (0.255)sin(10t) with respect to time using MATLAB plot e. Draw x4() (0.182)sin(14t) with respect to time using MATLAB plot f. Draw y(t)-xi(t) +x2(t) +x(t) xt) with respect to time using MATLAB plot g. Set axis to all graphs. (from 0 to 1 for x-axis, from -2 to 2 for y-axis) h. Describe the signal trends in your own words. 2. 3. 4. Predict the frequency contents of summed signal, y(t) Draw an amplitude vs frequency graph for summed signal, y(t), by hand. Write MATLAB code to generate 2-D graph for y(1) 1n frequency domain. (amplitude vs frequency) h 3 Result-Summedia%2Fa00%2Fa006db33-834b-4d4a-a97b-531. Write MATLAB code to generate following 2-D graphs. a. Generate a time variable from 0 to 1 [sec] in 0.001 [sec] step size b. Draw xi()- (1.274)sin(2Tt) with respect to time using MATLAB plot c. Draw x2() (0.425)sin(6Tt) with respect to time using MATLAB plot d. Draw x3(t)- (0.255)sin(10t) with respect to time using MATLAB plot e. Draw x4() (0.182)sin(14t) with respect to time using MATLAB plot f. Draw y(t)-xi(t) +x2(t) +x(t) xt) with respect to time using MATLAB plot g. Set axis to all graphs. (from 0 to 1 for x-axis, from -2 to 2 for y-axis) h. Describe the signal trends in your own words. 2. 3. 4. Predict the frequency contents of summed signal, y(t) Draw an “amplitude” vs “frequency” graph for summed signal, y(t), by hand. Write MATLAB code to generate 2-D graph for y(1) 1n frequency domain. (“amplitude” vs “frequency”) h 3 Result-Sum Show transcribed image text 1. Write MATLAB code to generate following 2-D graphs. a. Generate a time variable from 0 to 1 [sec] in 0.001 [sec] step size b. Draw xi()- (1.274)sin(2Tt) with respect to time using MATLAB plot c. Draw x2() (0.425)sin(6Tt) with respect to time using MATLAB plot d. Draw x3(t)- (0.255)sin(10t) with respect to time using MATLAB plot e. Draw x4() (0.182)sin(14t) with respect to time using MATLAB plot f. Draw y(t)-xi(t) +x2(t) +x(t) xt) with respect to time using MATLAB plot g. Set axis to all graphs. (from 0 to 1 for x-axis, from -2 to 2 for y-axis) h. Describe the signal trends in your own words. 2. 3. 4. Predict the frequency contents of summed signal, y(t) Draw an “amplitude” vs “frequency” graph for summed signal, y(t), by hand. Write MATLAB code to generate 2-D graph for y(1) 1n frequency domain. (“amplitude” vs “frequency”) h 3 Result-Sum

    Expert Answer


    . . .


    view full answer