Hi, I have this code so far and need to modify it so that the
output does not print something like 2x^0 but instead will just
print 2. Currently it prints 2x^0. I also am having a problem with
the output of Polynomial 1 - Polynomial 2. If both coefficient
values for the polynomials are equal instead of Polynomial 1 -
Polynomial 2 = 0 it outputs nothing. Just Polynomial 1 - Polynomial
2 =
For example if I input...
Modify the Movie List 2D program
-Modify the program so it contains four columns: name, year,
price and rating (G,PG,R…)
-Enhance the program so it provides a find by rating function
that lists all of the movies that have a specified rating
def list(movie_list):
if len(movie_list) == 0:
print("There are no movies in the list.\n")
return
else:
i = 1
for row in movie_list:
print(str(i) + ". " + row[0] + " (" + str(row[1]) + ")")
i += 1...
•Modify p4.c so that the output file p4.output is
created but also displayed to standard output ( the screen ). This
should be done by another instance of exec().
•Implement the pipe() command to do the
following:
$> grep –o else p4.c | wc
–l
p4.c
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <sys/wait.h>
int main(int argc, char *argv[]) {
int rc = fork();
if (rc < 0) {
// fork failed
fprintf(stderr, "fork...
Modify the GreenvilleRevenue program so that it uses the
Contestant class and performs the following tasks: The program
prompts the user for the number of contestants in this year’s
competition; the number must be between 0 and 30. The program
continues to prompt the user until a valid value is entered. The
expected revenue is calculated and displayed. The revenue is $25
per contestant. For example if there were 3 contestants, the
expected revenue would be displayed as: Revenue expected...
- What is the output of the following program?
StackPT stk1 = new ArrayStackPT( 10 );
StackPT stk2 = new ArrayStackPT( 10 );
StackPT stk3 = new ArrayStackPT( 10 );
StackPT stk4 = new ArrayStackPT( 10 );
QueuePT q1 = new ArrayQueuePT(10);
int n = 12;
while (n > 0){
stk1.push(n%2);
n = n/2;
}
String result = "";
while (! stk1.isEmpty()){
result += stk1.pop()+ " ";
}
System.out.println("the
output of stk1 : "+result); //___________
for(int i =0; i<10;...
Finish the following java question: Modify a
Encryption program so that it uses the following encryption
algorithm:
Every letter (both uppercase and lowercase) converted to
its successor except z and Z, which are converted to 'a' and 'A'
respectively (i.e., a to b, b to c, …, y to z, z to a, A to B, B to
C, …, Y to Z, Z to A)
Every digit converted to its predecessor except 0, which
is converted to 9 (i.e., 9...
"4. (Modify) Modify Program 7.14 so that the user inputs the
initial set of numbers when the program runs. Have the program
request the number of initial numbers to be entered."
//C++ Program 7.14 as follows
#include
#include
#include
#include
using namespace std;
int main()
{
const int NUMELS = 4;
int n[] = {136, 122, 109, 146};
int i;
vector partnums(n, n + NUMELS);
cout << "\nThe vector initially has the size of "
<< int(partnums.size()) << ",\n and...
Modify the below program so that the following two conditions
are met:
1. Each child terminates abnormally after attempting to write to
a location in the read-only text segment.
2. The parent prints output that is identical (except for the
PIDs) to the following:
child 12255 terminated by signal 11: Segmentation fault
child 12254 terminated by signal 11: Segmentation fault
Hint: Read the man page for psignal(3)
___________________________________.
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>...
Modify the Encryption program so that it uses the
following encryption algorithm:
Every letter (both uppercase and lowercase) converted to
its successor except z and Z, which are converted to 'a' and 'A'
respectively (i.e., a to b, b to c, …, y to z, z to a, A to B, B to
C, …, Y to Z, Z to A)
Every digit converted to its predecessor except 0, which
is converted to 9 (i.e., 9 to 8, 8 to...
Modify the AlienDirection program from this
chapter so that the image is not allowed to move out of the visible
area of the window. Ignore any key that would allow this to
happen.
*Ask if you have any questions about the assignment I will try
to clarify
Textbook - JAVA FOUNDATIONS: INTRODUCTION TO PROGRAM
DESIGN AND DATA STRUCTURES 5TH EDITION
Starter Code Provided :
import
javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import
javafx.scene.image.ImageView;
import
javafx.scene.input.KeyEvent;
import javafx.scene.paint.Color;
import javafx.stage.Stage;...