Questions
In C++ A new author is in the process of negotiating a contract for a new...

In C++

A new author is in the process of negotiating a contract for a new romance novel. The publisher is offering three options.

  • In the first option, the author is paid $5,000 upon delivery of the final manuscript and $20,000 when the novel is published.
  • In the second option, the author is paid 12.5% of the net price of the novel for each copy of the novel sold.
  • In the third option, the author is paid 10% of the net price for the first 4,000 copies sold, and 14% of the net price for the copies sold over 4,000.

The author has some idea about the number of copies that will be sold and would like to have an estimate of the royalties generated under each option.

Instructions

Write a program that prompts the author to enter:

  1. The estimated number of copies that will be sold.
  2. The net price of each copy of the novel

The program then outputs:

  1. The royalties under each option
  2. The best option the author could choose.
    • Ex. If option 1 is the best, output Option 1 is the best

(Use appropriate named constants to store the special values such as royalty rates and fixed royalties.)

Since your program handles currency, make sure to use a data type that can store decimals with a decimal precision of 2.

Example input:

120
22.99

Expected Output:

25000.0

344.8

275.8

Option 1 is the best

In: Computer Science

in java. using the following template as a method, public static void shellSort(int[] array) { create...

in java. using the following template as a method,

public static void shellSort(int[] array) {

create a program that counts the number of comparisons and swaps of the sorting method does using

int array1[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; // Best Case Test
int array2[] = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; // Worst Case Test
int array3[] = {10, 4, 8, 2, 6, 1, 9, 3, 7, 5}; // Average Case Test

and have the counsel print out the results.

In: Computer Science

What kind of network management protocols are available? What information can these protocols provide? Explain it...

What kind of network management protocols are available? What information can these protocols provide? Explain it with example.

In: Computer Science

What kind of network management protocols are available? What information can these protocols provide? Explain it...

What kind of network management protocols are available? What information can these protocols provide? Explain it with example. Note: NEED A UNIQUE ANSWER AND NO HANDWRITING PLEASE..

In: Computer Science

please use keyboard writing Please give a unique answer Q1/What are the roles of a project...

please use keyboard writing
Please give a unique answer

Q1/What are the roles of a project sponsor and the approval committee during the different SDLC phases?

part 2
Assume the following scenario:
A small company needs to develop an information system for the Finance and Accounting Department. As an analyst which process model would you prefer and why?

In: Computer Science

Using C++ : What am I doing wrong!?!? Problem Instructions: Implement a program that repeatedly outputs...

Using C++ : What am I doing wrong!?!?

Problem Instructions: Implement a program that repeatedly outputs an I of a size entered by the user. Prompt the user for a size. If -1 is entered, quit the program. If an even number or a number smaller than 3 is entered, prompt the user again. Then output a shape of # characters that represent an I. Repeat the program until -1 is entered.

What I have so far:

#include <iostream>

#include <iomanip>

using namespace std;

int main()

{

int num;

cout << endl;

cout << " Please enter an ODD number greater than 2: " << endl;

cin >> num;

if (num!= -1)

{

while (num >= 3 && num % 2 == 1)

{

do //Runs if num is invalid

{

if (num %2 == 0)

{

//header

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

{

cout << "#";

}

//middle

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

{

cout << endl;

for (int i = 1; i <= num / 2; i++)

{

cout << " ";

}

cout << "#";

}

cout << endl;

//footer

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

{

cout << "#";

}

}

} while (num >= 3 && num % 2 == 1);

}

}

return 0;

}

In: Computer Science

Integer value calculator: Write a program using C++ that acts as a calculator. The program should...

Integer value calculator: Write a program using C++ that acts as a calculator. The program should ask the user for two numbers and an operator. Then the program must print the result using the two input values and the operator.

Prompts and input requirements. Ask the user for two integer values and a value that indicates the operation. Likely you will want to choose the normal operators: + - * / %.

Output Requirements: Make your output easy to understand, both in the prompts and when printing the result.

Input Validation. The program should validate all input from the user and print an error message if the input is not valid. The integer values must be between -30,000 and + 30,000 and the operators must be one of these: + - * / %. If the input is not valid, the program should exit without printing a result.

In: Computer Science

Write a program that asks the user for a number of seconds and tells them how...

Write a program that asks the user for a number of seconds and tells them how
many hours, minutes and seconds it is. Make sure your program works correctly
for values smaller than the whole hour or whole minute. Here’s what the sample
output from several runs of your program would look like:
Please enter the number of seconds: 2
2 seconds
>>>
Please enter the number of seconds: 500
8 minutes 20 seconds
>>>
Please enter the number of seconds: 20000
5 hours 33 minutes 20 seconds
Hint: you may find mod and div operations helpful here. You will need to use
branching statements (ifs) in this program.

use python

In: Computer Science

Determine a) the output of each algorithm below b) the number of assignment operations in each...

Determine
a) the output of each algorithm below
b) the number of assignment operations in each (show work)
c) the number of print operations in each (show work)
d) the complexity of each algorithm in terms of Big O notation (show work)
1.
Let n be a given positive integer, and let myList be a three-dimensional array with capacity n for each dimension.
for each index i from 1 to n do
{
for each index j from 1 to n do
{
for each index k from 1 to n do
{
​myList[ i ] [ j ] [ k ] = i;
Print the element at myList[ i ] [ j ] [ k ];
}
}
}
2.
Let n be a given positive integer, and let myList be a three-dimensional array with capacity n for each dimension.
for each index i from 1 to n do
{
for each index j from 1 to n/2 do
{
for each index k from 1 to n/2 do
{
​myList[ i ] [ j ] [ k ] = i;
Print the element at myList[ i ] [ j ] [ k ];
}
}
}
3.
Let n be a given positive integer, and let myList be a three-dimensional array with capacity n for each dimension.
for each index i from 1 to n do
{
for each index j from 1 to n/4 do
{
for each index k from 1 to n/4 do
{
​myList[ i ] [ j ] [ k ] = i;
Print the element at myList[ i ] [ j ] [ k ];
}
}
}

In: Computer Science

Show step-by-step how Java will evaluate the following expression: 8 % 3 + 3 % 2...

Show step-by-step how Java will evaluate the following expression:

    8 % 3 + 3 % 2 – 9 % 2.0 * 5

      15/15 % 7 *2   – 11. /4 * 5

      In: Computer Science

      Internet Service provider Part 1 (Java Program) An Internet service provider has three different subscription packages...

      Internet Service provider Part 1 (Java Program)

      An Internet service provider has three different subscription packages for its customers:

      Package A: For $9.95 per month 10 hours of access are provided. Additional hours are $2.00 per hour.

      Package B: For $13.95 per month 20 hours of access are provided. Additional hours are $1.00 per hour.

      Package C: For $19.95 per month unlimited access is provided.

      Write a program that calculates a customer’s monthly bill. It should ask the user to enter the letter of the package the customer has purchased (A, B, or C) and the number of hours that were used. It should then display the total charges.

      Part 2

      Modify the program you wrote for Part 1 so it also calculates and displays the amount of money Package A customers would save if they purchased Package B or C, the amount of money Package B customers would save if they purchased Package A or Package C, and the amount of money Package C customers would save if they purchased Package A or Package B . If there would be no savings, no message should be printed.

      In: Computer Science

      Write a MIPS Assembly Language program to perform the following operations: Request and read two integers...

      Write a MIPS Assembly Language program to perform the following operations:

      Request and read two integers from the console (Dn and Up),

      Call a recursive function to compute the result

      int RecurseFunc( int Dn, int Up )

      {

      if( Dn < 1 ) return 0;

      else return Dn * Up + RecurseFunc( Dn - 1, Up + 1 );

      }

      Print out the results

      Submit your code and report here.

      In: Computer Science

      The following is a structure template: struct box { char maker[40]; float height; float width; float...

      The following is a structure template:

      struct box

      {

      char maker[40];

      float height;

      float width;

      float length;

      float volume;

      };

      a. Write a function that has a reference to a box structure as its formal argument

      and displays the value of each member.

      b. Write a function that has a reference to a box structure as its formal argument

      and sets the volume member to the product of the other three dimensions.

      In: Computer Science

      inverse a matrix using pseudo inverse using python (numpy can be used) for a 2d list...

      inverse a matrix using pseudo inverse using python (numpy can be used) for a 2d list (n x n).

      In: Computer Science

      JAVA the task is to implement the missing methods in the LinkedIntSet class. Each method you...

      JAVA

      the task is to implement the missing methods in the LinkedIntSet class. Each method you must write has comments describing how it should behave. You may not add any new fields to the LinkedIntSet class and you may only add new code inside the bodies of the 5 methods you are asked to write. You may also write new private helper methods. However, you may not change any method headers, you may not change any code outside of the 5 methods, and you may not add any new data fields to the class.

      public class LinkedIntSet {
         private static class Node {
             private int data;
             private Node next;
            
             public Node(int data, Node next) {
                 this.data = data;
                 this.next = next;
             }
         }
        
         private Node first;

         public LinkedIntSet() {
             first = null;
         }

         public int size() {
             int counter = 0;
             for (Node current = first; current != null; current = current.next)
                 counter++;
             return counter;
         }

         public boolean contains(int i) {
             for (Node current = first; current != null; current = current.next) {
                 if (current.data == i)
                     return true;
             }
             return false;
         }

         // Ignore this equals method. Write the code for the other equals method.
         public boolean equals(Object otherObject) {
             LinkedIntSet other = (LinkedIntSet) otherObject;
             return this.equals(other);
         }

         /***************************** NEW METHODS ************************************/

         /**
         * Adds <code>element</code> to this set if it is not already present and
         * returns <code>true</code>. If <code>element</code> is already present, the
         * set is unchanged and <code>false</code> is returned.
         *
         * @param element the element to be added
         * @return <code>true</code> if the element was added and <code>false</code>
         * otherwise.
         */
         public boolean addElement(int element) {
             // Replace the line below with your answer
             throw new RuntimeException("Not implemented");
         }

         /**
         * Removes an element from the set.
         *
         * @param element the element to be removed
         * @return <code>ture</code> if the element was removed and <code>false</code>
         * otherwise.
         */
         public boolean removeElement(int element) {
             // Replace the line below with your answer
             throw new RuntimeException("Not implemented");

      }

         /**
         * Changes the set so that it is equal the union of itself and
         * <code>other</code>.
         *
         * @param other the set to union with
         */
         public void union(LinkedIntSet other) {
             // Replace the line below with your answer
             throw new RuntimeException("Not implemented");
         }

         /**
         * Changes the set so that is equal the intersection of itself and
         * <code>other</code>.
         *
         * @param other the set to intersect with
         */
         public void intersect(LinkedIntSet other) {
             // Replace the line below with your answer
             throw new RuntimeException("Not implemented");
         }
      }

      In: Computer Science