Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask Computer Engineering Expert

problem 1: Here is a short program. This prints out the value of a variable "x". Ernie and Bert disagree about what will be printed: Ernie says, the value gets changed in "changeX" so it will print "7", and Bert says, no, when the function exits the changes get reversed and the value goes back to "5". describe who is correct and why.

int x = 5;
void draw()
{
   changeX();
   print(x);
}
voidchangeX()
{
   int x = 7;
}

problem 2: prepare out pseudocode for a function called "and" that takes two arguments, both booleans, and returns the logical and of the inputs. DO NOT use the logical and operator: instead, prepare out if statements that cover the possibilities.

problem 3: You are going to prepare a function that computes the total interest charged on a credit card before it is paid off. List all the inputs the function will need.

problem 4: prepare a function that draws a cow at a certain location on the screen, and use the function to draw a herd of cows (at least 10).

problem 5: prepare a function that takes an array as the argument and returns the second largest element. Bonus (+5): prepare a function that takes an array and a number n as arguments and returns the nth-largest element. (So if n = 5, it returns the fifth largest.)

problem 6: prepare a function that computes f(x) for a quadratic polynomial in x, such as the one in assignment 3. Use the function to plot f(x) from -10 to +10.

problem 7: prepare a function to determine whether a number is prime: it will return true if the input is prime and false otherwise. Use it to see whether -7 is prime.

problem 8: Create an array of Strings and fill it with some interesting text, such as vacation destinations, album names, or weapon names from a CRPG. Display three elements of the array on the screen at a time; allow the user to scroll through the list with keypresses (e.g., 'a' to advance the list, 's' to go back).

problem 9: prepare a function that takes in a number n and divides the screen into n vertical bars, alternating black and white. (What should you do if someone puts in n = 0 or n = -99?)

problem 10: prepare a function that takes in a radius and evenly covers the screen with circles of that radius. Don't attempt to draw any circles that are completely off the screen.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91240

Have any Question? 


Related Questions in Computer Engineering

In computer science when we encounter an algorithm we often

In computer science, when we encounter an algorithm, we often need to ask about the complexity of that algorithm (how many computations we need to do). To find the complexity of the distance vector's algorithm, find the ...

Assignment designing ferpa technical safeguardsimagine you

Assignment: Designing FERPA Technical Safeguards Imagine you are an Information Security consultant for a small college registrar's office consisting of the registrar and two assistant registrars, two student workers, an ...

Computer aided engineering final examq1 figure shows a

Computer Aided Engineering Final Exam Q1. Figure shows a concrete reinforced slab undergoing deflection under its own weight. Using the FEM principles (stiffness method), calculate a. Deflection and reactions at the node ...

1 list and describe four vulnerability intelligence sources

1. List and describe four vulnerability intelligence sources. Of those that you listed, which seems the most effective? Why? 2. What does CERT stand for? Is there more than one CERT? What is the purpose of a CERT?

1 study the history of the development of computer products

1. Study the history of the development of computer products security evaluation and suggest the reasons that led to the development of ISO-based CC. 2. Study and give the effects of ISO on a criterion. Does ISO affiliat ...

Create a c program that computes the areas of rectangles

Create a C++ program that computes the areas of rectangles and tells the user which rectangle has the greatest area, or if the areas are the same. Create a C++ program that calculates the gross cost and net cost for call ...

Question 1polybius was an ancient greek writer who first

Question 1 Polybius was an ancient Greek writer who first proposed a method of substituting different two-digit numbers for each letter. The alphabet is written inside a 5-by-5 square matrix which has numbered rows and c ...

1 show a pipeline execution diagram for the third iteration

1. Show a pipeline execution diagram for the third iteration of this loop, from the cycle in which we fetch the first instruction of that iteration up to (but not including) the cycle in which we can fetch the first inst ...

One of the objects groups that can be managed is the ip

One of the objects (groups) that can be managed is the ip group with the object identifier (1.3.6.1.2.1.4) in which (1.3.6.1.2.1) is the identifier of MIB-2 and (4) defines the ip group. In an agent, this object has 20 s ...

Objective -the purpose of this program is to generate

Objective - The purpose of this program is to generate random numbers, report total number created, how many were 15, 16, or 17 and report this information to the user. You are required to use array, pointer and customis ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

WalMart Identification of theory and critical discussion

Drawing on the prescribed text and/or relevant academic literature, produce a paper which discusses the nature of group

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro