Search

Custom Search

Thursday, November 25, 2010

computer science assignment

Please have someone to write a DETAIL step by step solution with solution and explanation. Thank You
Lab: 
Part A: Video Game Player Program
Step 1: Requirements
Write a program to do the following.  In main declare a Player Name Array and a Score Array.  Declare the size of the arrays to be 100.  In the InputData function input the player name and score into the arrays for an unknown number of players up to 100.  In the DisplayPlayerData function display the name and score of each player.  In the CalculateAverageScore function calculate the average score and return it by value.  In the DisplayBelowAverage function display the name of the player and score for any player who scored below the average.  Do not use global variables.  
Output from Program: 
Enter Player Name (Q to quit): Bob
Enter score for Bob: 3245
Enter Player Name (Q to quit): Sue
Enter score for Sue: 1098
Enter Player Name (Q to quit): Dave
Enter score for Dave: 8219
Enter Player Name (Q to quit): Pat
Enter score for Pat: 3217
Enter Player Name (Q to quit): Q   
Name   Score
Bob        3245
Sue        1098
Dave       8219
Pat        3217 
Average Score: 3944.75 
Players who scored below average   
Name    Score
Bob        3245
Sue        1098
Pat        3217
Press any key to continue . . . 
Step 2: Processing Logic
Using the pseudo code below, write the code that will meet the requirements:  
Main Function   
Declare the player name and score arrays, number of players, and average score.    
Call the InputData function   
Call the DisplayPlayerData function   
Call the CalculateAverageScore function and assign the returned value in average score   
Call the DisplayBelowAverage function  
InputData function    
While the number of players is less than the length of the array        
Prompt for the player's name        
If the user entered Q, break out of the loop        
Prompt the user for the player's score         
Add 1 to the number of players    
End-While 
DisplayPlayerData function    
Display the name and score of each player  
CalculateAverageScore function    
Add up the scores and divide by the number of scores to calculate the average score    
Display the average score    
Return the average score to main 
DisplayBelowAverage function    
Display the names and scores of all players who scored below the average score 
Step 3: Create a new project
Create a new project and name it LAB5A. 
Write your code using the Processing Logic in Part A Step 2.  Make sure you save your program.
Step 4: Compile and Execute
a)    Compile your program.  Eliminate all syntax errors.  
b)    Build your program and verify the results of the program.  Make corrections to the program logic if necessary until the results of the program execution are what you expect. 
Step 5: Print Screen Shots and Program

1.    Capture a screen print of your output [Do a PRINT SCREEN and paste into an MS Word document.]
2.    Copy your code and Paste it into the same MS Word document that contains the screen print of your output.
3.    Save the Word Document as Lab05A_LastName_FirstInitial    
END OF PART A
 
   


Part B: Pig Latin
Step 1: Requirements
Write a program that will input a phrase and convert it to pig latin.  Put each word in a separate element of a string array.  Remove the first letter from each word and concatenate it to the end of the word followed by "ay".         
Sample Output from Program: 
*** You will be prompted to enter a string of  ***
*** words. The string will be converted into   ***
*** Pig Latin and the results displayed.       ***
*** Enter as many strings as you would like.   *** 
Enter a group of words or ENTER to quit: DeVry is a wonderful school 
Original words: DeVry is a wonderful school
New Words: eVryDay siay aay onderfulway choolsay 
Enter a group of words or ENTER to quit: The Cowbows are going to the Superbowl 
Original words: The Cowbows are going to the Superbowl
New Words: heTay owbowsCay reaay oinggay otay hetay uperbowlSay 
Enter a group of words or ENTER to quit: 
Step 2: Processing Logic
Using the pseudo code below, write the code that will meet the requirements.  
Main function    
Display the heading    
While the condition is true            
Prompt the user for group of words or Enter to quit            
Display original words            
Call function pigLatinString( )    
End while 
pigLatinString( ) function    
Declare and initialize string variables len, counter, start, begin, word and newString    
While condition is true            
Call find() and pass a space and start as parameters and return the returned value            
to start            
if start equals to string::npos            
jump outside the loop permanently            
call substr() function            
display the word            
update newString            
increment start by one            
assign start to begin   
End While
Call substr()
Update newString
Return newString 
Step 3: Create a new project
Create a new project and name it LAB5B. 
Write your code using the Processing Logic in Part B Step 2.  Make sure you save your program.
Step 4: Compile and Execute
a)    Compile your program.  Eliminate all syntax errors.  
b)    Build your program and verify the results of the program.  Make corrections to the program logic if necessary until the results of the program execution are what you expect. 
Step 5: Print Screen Shots and Program

1.    Capture a screen print of your output [Do a PRINT SCREEN and paste into an MS Word document.]
2.    Copy your code and Paste it into the same MS Word document that contains the screen print of your output.
3.    Save the Word Document as Lab05B_LastName_FirstInitial    
END OF LAB

computer science assignment

Please have someone to write a DETAIL step by step solution with solution and explanation. Thank You
Lab: 
Part A: Video Game Player Program
Step 1: Requirements
Write a program to do the following.  In main declare a Player Name Array and a Score Array.  Declare the size of the arrays to be 100.  In the InputData function input the player name and score into the arrays for an unknown number of players up to 100.  In the DisplayPlayerData function display the name and score of each player.  In the CalculateAverageScore function calculate the average score and return it by value.  In the DisplayBelowAverage function display the name of the player and score for any player who scored below the average.  Do not use global variables.  
Output from Program: 
Enter Player Name (Q to quit): Bob
Enter score for Bob: 3245
Enter Player Name (Q to quit): Sue
Enter score for Sue: 1098
Enter Player Name (Q to quit): Dave
Enter score for Dave: 8219
Enter Player Name (Q to quit): Pat
Enter score for Pat: 3217
Enter Player Name (Q to quit): Q   
Name   Score
Bob        3245
Sue        1098
Dave       8219
Pat        3217 
Average Score: 3944.75 
Players who scored below average   
Name    Score
Bob        3245
Sue        1098
Pat        3217
Press any key to continue . . . 
Step 2: Processing Logic
Using the pseudo code below, write the code that will meet the requirements:  
Main Function   
Declare the player name and score arrays, number of players, and average score.    
Call the InputData function   
Call the DisplayPlayerData function   
Call the CalculateAverageScore function and assign the returned value in average score   
Call the DisplayBelowAverage function  
InputData function    
While the number of players is less than the length of the array        
Prompt for the player's name        
If the user entered Q, break out of the loop        
Prompt the user for the player's score         
Add 1 to the number of players    
End-While 
DisplayPlayerData function    
Display the name and score of each player  
CalculateAverageScore function    
Add up the scores and divide by the number of scores to calculate the average score    
Display the average score    
Return the average score to main 
DisplayBelowAverage function    
Display the names and scores of all players who scored below the average score 
Step 3: Create a new project
Create a new project and name it LAB5A. 
Write your code using the Processing Logic in Part A Step 2.  Make sure you save your program.
Step 4: Compile and Execute
a)    Compile your program.  Eliminate all syntax errors.  
b)    Build your program and verify the results of the program.  Make corrections to the program logic if necessary until the results of the program execution are what you expect. 
Step 5: Print Screen Shots and Program

1.    Capture a screen print of your output [Do a PRINT SCREEN and paste into an MS Word document.]
2.    Copy your code and Paste it into the same MS Word document that contains the screen print of your output.
3.    Save the Word Document as Lab05A_LastName_FirstInitial    
END OF PART A
 
   


Part B: Pig Latin
Step 1: Requirements
Write a program that will input a phrase and convert it to pig latin.  Put each word in a separate element of a string array.  Remove the first letter from each word and concatenate it to the end of the word followed by "ay".         
Sample Output from Program: 
*** You will be prompted to enter a string of  ***
*** words. The string will be converted into   ***
*** Pig Latin and the results displayed.       ***
*** Enter as many strings as you would like.   *** 
Enter a group of words or ENTER to quit: DeVry is a wonderful school 
Original words: DeVry is a wonderful school
New Words: eVryDay siay aay onderfulway choolsay 
Enter a group of words or ENTER to quit: The Cowbows are going to the Superbowl 
Original words: The Cowbows are going to the Superbowl
New Words: heTay owbowsCay reaay oinggay otay hetay uperbowlSay 
Enter a group of words or ENTER to quit: 
Step 2: Processing Logic
Using the pseudo code below, write the code that will meet the requirements.  
Main function    
Display the heading    
While the condition is true            
Prompt the user for group of words or Enter to quit            
Display original words            
Call function pigLatinString( )    
End while 
pigLatinString( ) function    
Declare and initialize string variables len, counter, start, begin, word and newString    
While condition is true            
Call find() and pass a space and start as parameters and return the returned value            
to start            
if start equals to string::npos            
jump outside the loop permanently            
call substr() function            
display the word            
update newString            
increment start by one            
assign start to begin   
End While
Call substr()
Update newString
Return newString 
Step 3: Create a new project
Create a new project and name it LAB5B. 
Write your code using the Processing Logic in Part B Step 2.  Make sure you save your program.
Step 4: Compile and Execute
a)    Compile your program.  Eliminate all syntax errors.  
b)    Build your program and verify the results of the program.  Make corrections to the program logic if necessary until the results of the program execution are what you expect. 
Step 5: Print Screen Shots and Program

1.    Capture a screen print of your output [Do a PRINT SCREEN and paste into an MS Word document.]
2.    Copy your code and Paste it into the same MS Word document that contains the screen print of your output.
3.    Save the Word Document as Lab05B_LastName_FirstInitial    
END OF LAB

computer science assignment

write to me Pollard Rho's algorithm for factorization on Java "all coding with a result"

computer science assignment

Operating Systems Concepts
CSci 474
Project #2: Threads and semaphores
Due Date: 11:55PM, December 1, 2010
I. Project Organization
This project will study multiple thread programming, using semaphores and POSIX.
You should do the following pieces to complete your project. Each piece is explained below:
• Design 10 points
• Code 25 points
• Output 10 points
• Summary 5 points
Design
List each semaphore with its purpose and initial value. Provide pseudocode for each thread.
Code
Your code should be nicely formatted with plenty of comments. The code should be easy to read,
properly indented, employ good naming standards, good structure, and should correctly implement the
design.
Output
Output will be graded by running your program on the UNIX machines in Lab 244.
Summary
The summary section should discuss your simulation, any difficulties encountered, what was learned,
and results. It should be at least one page.
II. Project Description
You must complete this project based on POSIX.
This project simulates a game through multithreading. The following rules apply:
1. The main thread creates a server thread and two player threads.
2. A player thread is blocked until a server thread is created - the player thread cannot join a game
until the server thread is created.
3. Each game must have exactly two players -- the server thread cannot start the game until two
players join the game.
4. After the game starts, each player thread randomly generates an integer and passes this integer to
the server thread.
5. The server is waiting for randomly generated integers from two players.
6. The player threads wait for the result from the server.
7. The server thread compares integers and notifies two player threads the result (the thread which
generates a larger integer wins). Game ends.
Your output must show all activities in each thread.
For example:
Main thread creates the server thread.
Main thread creates the player thread 1.
Main thread creates the player thread 2.
Server threat starts.
Player thread 2 starts.
Player thread 1 starts.
Player thread 1 joins the game.
Player thread 2 joins the game.
Server thread starts the game.
Player thread 2 passes 123 to the server.
Player thread 1 passes 234 to the server.
Server announces player 1 wins the game.
GAME OVER.
III. Project Guidelines
Submitting
Submit your project on Blackboard. Include in your submission the following files:
1) A Word document for the written pieces of the project
2) Your source files
NO hardcopy submission. Late submission will NOT be accepted.
Cheating
All work must be your own. If cheating is detected, all parties involved will be given a zero for the project
and the penalty will be documented on a form that you must sign. You may be referred to the Dean's
office for further discussion.
Grading
The written portions will be graded subjectively based on completeness and quality. The code will be
graded based on points allocated for each key part of the processing as determined by the instructor. The
output will be graded based on expected results for the runs.

computer science assignment

Operating Systems Concepts
CSci 474
Project #2: Threads and semaphores
Due Date: 11:55PM, December 1, 2010
I. Project Organization
This project will study multiple thread programming, using semaphores and POSIX.
You should do the following pieces to complete your project. Each piece is explained below:
• Design 10 points
• Code 25 points
• Output 10 points
• Summary 5 points
Design
List each semaphore with its purpose and initial value. Provide pseudocode for each thread.
Code
Your code should be nicely formatted with plenty of comments. The code should be easy to read,
properly indented, employ good naming standards, good structure, and should correctly implement the
design.
Output
Output will be graded by running your program on the UNIX machines in Lab 244.
Summary
The summary section should discuss your simulation, any difficulties encountered, what was learned,
and results. It should be at least one page.
II. Project Description
You must complete this project based on POSIX.
This project simulates a game through multithreading. The following rules apply:
1. The main thread creates a server thread and two player threads.
2. A player thread is blocked until a server thread is created - the player thread cannot join a game
until the server thread is created.
3. Each game must have exactly two players -- the server thread cannot start the game until two
players join the game.
4. After the game starts, each player thread randomly generates an integer and passes this integer to
the server thread.
5. The server is waiting for randomly generated integers from two players.
6. The player threads wait for the result from the server.
7. The server thread compares integers and notifies two player threads the result (the thread which
generates a larger integer wins). Game ends.
Your output must show all activities in each thread.
For example:
Main thread creates the server thread.
Main thread creates the player thread 1.
Main thread creates the player thread 2.
Server threat starts.
Player thread 2 starts.
Player thread 1 starts.
Player thread 1 joins the game.
Player thread 2 joins the game.
Server thread starts the game.
Player thread 2 passes 123 to the server.
Player thread 1 passes 234 to the server.
Server announces player 1 wins the game.
GAME OVER.
III. Project Guidelines
Submitting
Submit your project on Blackboard. Include in your submission the following files:
1) A Word document for the written pieces of the project
2) Your source files
NO hardcopy submission. Late submission will NOT be accepted.
Cheating
All work must be your own. If cheating is detected, all parties involved will be given a zero for the project
and the penalty will be documented on a form that you must sign. You may be referred to the Dean's
office for further discussion.
Grading
The written portions will be graded subjectively based on completeness and quality. The code will be
graded based on points allocated for each key part of the processing as determined by the instructor. The
output will be graded based on expected results for the runs.

computer science assignment

Operating Systems Concepts
CSci 474
Project #2: Threads and semaphores
Due Date: 11:55PM, December 1, 2010
I. Project Organization
This project will study multiple thread programming, using semaphores and POSIX.
You should do the following pieces to complete your project. Each piece is explained below:
• Design 10 points
• Code 25 points
• Output 10 points
• Summary 5 points
Design
List each semaphore with its purpose and initial value. Provide pseudocode for each thread.
Code
Your code should be nicely formatted with plenty of comments. The code should be easy to read,
properly indented, employ good naming standards, good structure, and should correctly implement the
design.
Output
Output will be graded by running your program on the UNIX machines in Lab 244.
Summary
The summary section should discuss your simulation, any difficulties encountered, what was learned,
and results. It should be at least one page.
II. Project Description
You must complete this project based on POSIX.
This project simulates a game through multithreading. The following rules apply:
1. The main thread creates a server thread and two player threads.
2. A player thread is blocked until a server thread is created - the player thread cannot join a game
until the server thread is created.
3. Each game must have exactly two players -- the server thread cannot start the game until two
players join the game.
4. After the game starts, each player thread randomly generates an integer and passes this integer to
the server thread.
5. The server is waiting for randomly generated integers from two players.
6. The player threads wait for the result from the server.
7. The server thread compares integers and notifies two player threads the result (the thread which
generates a larger integer wins). Game ends.
Your output must show all activities in each thread.
For example:
Main thread creates the server thread.
Main thread creates the player thread 1.
Main thread creates the player thread 2.
Server threat starts.
Player thread 2 starts.
Player thread 1 starts.
Player thread 1 joins the game.
Player thread 2 joins the game.
Server thread starts the game.
Player thread 2 passes 123 to the server.
Player thread 1 passes 234 to the server.
Server announces player 1 wins the game.
GAME OVER.
III. Project Guidelines
Submitting
Submit your project on Blackboard. Include in your submission the following files:
1) A Word document for the written pieces of the project
2) Your source files
NO hardcopy submission. Late submission will NOT be accepted.
Cheating
All work must be your own. If cheating is detected, all parties involved will be given a zero for the project
and the penalty will be documented on a form that you must sign. You may be referred to the Dean's
office for further discussion.
Grading
The written portions will be graded subjectively based on completeness and quality. The code will be
graded based on points allocated for each key part of the processing as determined by the instructor. The
output will be graded based on expected results for the runs.

case study assignment


Northeastern University (NEU) is now ranked among the top 100 research institutions in the United States.  This was not always the case.  As part of a methodical process and thanks to a significant investment of time, energy and money, the University reengineered its curriculum, improved the quality of its teaching and research faculty, built up its campus facilities, and rebranded itself.   Along the way, the institution could have misdirected its efforts and resources.  Fortunately, Northeastern’s leadership recognized the value of data-driven decision making.  Early on in the remaking of the University, NEU established a decision support system (DSS) to inform planning.    For example, in the early 1990’s, NEU stood firmly in the third tier of ranked U.S. Colleges and Universities, due in no small part to a student retention rate near 35%.  The University was determined to improve on this vital metric (today retention is closer to 85%), but to that end NEU needed to determine what factors/investments might substantial improve student retention rates.  By mining years of student cohort data, the University’s leadership determined those factors that influenced the student’s ability to stay at NEU through graduation.
The enabling information system, (i.e. the University’s first decision support system - DSS) drew on key University transaction systems for its data, including: the Registrar System, the Financial Aid System, the Human Resource System, and the Financial Management System.  Led by a technical team draw from the University’s Information Technology Services (ITS) Unit, a large cross-functional committee of stakeholders, including academic and administrative leaders from across campus, identified the data to be collected by the DSS and devised a common set of definitions, metadata standards and the like to ensure the quality and integrity of the data collection/translation process.  The IT team employed extract–transform-and-load (ETL) tools to draw the data from the aforementioned source systems and to load it into a specially designed data warehouse.  Rather than try to recreate data sets historically, the stakeholder committee agreed to start the DSS process and data collection with the most current body of transaction data, beginning with the Fall term of the 2002-2003 academic year.  The data warehouse now holds nearly nine full academic years of longitudinal data, including 36 data discrete sets as of Summer II term, 2010.
Once the data warehouse was fully deployed and once the automated procedures were in place to extract key data from the school’s various systems of record, the data warehouse was ready for use in decision support.   A team of analysts, working under the general direction of the Senior Vice President for Planning, mined this DSS data source looking for the underlying predictors of student retention and academic performance, tends in course registration and faculty and facilities utilization, demographic shifts in the student body, and many other high-level tactical and strategic issues facing the University’s leadership.  As the process added more academic terms of data to the data warehouse, the opportunities for richer and more focuses analysis became available to the DSS team.
To date the Northeastern University DSS has been used to inform the institutions policies and processes for delivering student services, to direct its building programs choices – especially regarding the construction of new student residents’ halls, and to focus faculty hiring and academic program development.  In turn these decisions have improved overall student satisfaction and retention, and school performance, vaulting NEU into the elite 100.


Question to Address:
1.      What technical components comprised NEU’s decision support system?
2.      Who were the key stakeholders in the process and why were they so important?
3.      To what would you attribute the DSS project’s success and how would you measure and assess outcomes?
4.      Without a DSS, how would NEU inform its decision making?  What are the shortfalls in these alternative approaches to decision making?

computer science assignment

Operating Systems Concepts
CSci 474
Project #2: Threads and semaphores
Due Date: 11:55PM, December 1, 2010
I. Project Organization
This project will study multiple thread programming, using semaphores and POSIX.
You should do the following pieces to complete your project. Each piece is explained below:
• Design 10 points
• Code 25 points
• Output 10 points
• Summary 5 points
Design
List each semaphore with its purpose and initial value. Provide pseudocode for each thread.
Code
Your code should be nicely formatted with plenty of comments. The code should be easy to read,
properly indented, employ good naming standards, good structure, and should correctly implement the
design.
Output
Output will be graded by running your program on the UNIX machines in Lab 244.
Summary
The summary section should discuss your simulation, any difficulties encountered, what was learned,
and results. It should be at least one page.
II. Project Description
You must complete this project based on POSIX.
This project simulates a game through multithreading. The following rules apply:
1. The main thread creates a server thread and two player threads.
2. A player thread is blocked until a server thread is created - the player thread cannot join a game
until the server thread is created.
3. Each game must have exactly two players -- the server thread cannot start the game until two
players join the game.
4. After the game starts, each player thread randomly generates an integer and passes this integer to
the server thread.
5. The server is waiting for randomly generated integers from two players.
6. The player threads wait for the result from the server.
7. The server thread compares integers and notifies two player threads the result (the thread which
generates a larger integer wins). Game ends.
Your output must show all activities in each thread.
For example:
Main thread creates the server thread.
Main thread creates the player thread 1.
Main thread creates the player thread 2.
Server threat starts.
Player thread 2 starts.
Player thread 1 starts.
Player thread 1 joins the game.
Player thread 2 joins the game.
Server thread starts the game.
Player thread 2 passes 123 to the server.
Player thread 1 passes 234 to the server.
Server announces player 1 wins the game.
GAME OVER.
III. Project Guidelines
Submitting
Submit your project on Blackboard. Include in your submission the following files:
1) A Word document for the written pieces of the project
2) Your source files
NO hardcopy submission. Late submission will NOT be accepted.
Cheating
All work must be your own. If cheating is detected, all parties involved will be given a zero for the project
and the penalty will be documented on a form that you must sign. You may be referred to the Dean's
office for further discussion.
Grading
The written portions will be graded subjectively based on completeness and quality. The code will be
graded based on points allocated for each key part of the processing as determined by the instructor. The
output will be graded based on expected results for the runs.

computer science assignment

Operating Systems Concepts
CSci 474
Project #2: Threads and semaphores
Due Date: 11:55PM, December 1, 2010
I. Project Organization
This project will study multiple thread programming, using semaphores and POSIX.
You should do the following pieces to complete your project. Each piece is explained below:
• Design 10 points
• Code 25 points
• Output 10 points
• Summary 5 points
Design
List each semaphore with its purpose and initial value. Provide pseudocode for each thread.
Code
Your code should be nicely formatted with plenty of comments. The code should be easy to read,
properly indented, employ good naming standards, good structure, and should correctly implement the
design.
Output
Output will be graded by running your program on the UNIX machines in Lab 244.
Summary
The summary section should discuss your simulation, any difficulties encountered, what was learned,
and results. It should be at least one page.
II. Project Description
You must complete this project based on POSIX.
This project simulates a game through multithreading. The following rules apply:
1. The main thread creates a server thread and two player threads.
2. A player thread is blocked until a server thread is created - the player thread cannot join a game
until the server thread is created.
3. Each game must have exactly two players -- the server thread cannot start the game until two
players join the game.
4. After the game starts, each player thread randomly generates an integer and passes this integer to
the server thread.
5. The server is waiting for randomly generated integers from two players.
6. The player threads wait for the result from the server.
7. The server thread compares integers and notifies two player threads the result (the thread which
generates a larger integer wins). Game ends.
Your output must show all activities in each thread.
For example:
Main thread creates the server thread.
Main thread creates the player thread 1.
Main thread creates the player thread 2.
Server threat starts.
Player thread 2 starts.
Player thread 1 starts.
Player thread 1 joins the game.
Player thread 2 joins the game.
Server thread starts the game.
Player thread 2 passes 123 to the server.
Player thread 1 passes 234 to the server.
Server announces player 1 wins the game.
GAME OVER.
III. Project Guidelines
Submitting
Submit your project on Blackboard. Include in your submission the following files:
1) A Word document for the written pieces of the project
2) Your source files
NO hardcopy submission. Late submission will NOT be accepted.
Cheating
All work must be your own. If cheating is detected, all parties involved will be given a zero for the project
and the penalty will be documented on a form that you must sign. You may be referred to the Dean's
office for further discussion.
Grading
The written portions will be graded subjectively based on completeness and quality. The code will be
graded based on points allocated for each key part of the processing as determined by the instructor. The
output will be graded based on expected results for the runs.

computer science assignment


write to me Pollard Rho's algorithm for factorization on Java "all coding with a result"

computer science assignment


My project is about a volatily surface built from a Black and Scholes class. If we don't have the volatility, we have to find the implied volatility and then use that to have the volatility surface. 
 
 
I have a HW of a volatility surface on C++. I have already started but instead of improving my program has lots and lots of errors. Instead of having my program done from someone else, I would like to have a tutor who can work with me in order to solve those errosr and get the program running. 
 
I have already started but I have many errors and I think it's not working properly. 
Enclosed is what I have done so far. This is a project in groups so a classmate sent his files:
* QuantLib
* Calendar
* date
* exception
* FavFive
* yieldcurve
* FixedIncome
* Interpolation
* Number_theory
* strings
 
My files are:
1.  BlackScholes including the greeks that are already in the program. In this class, time is the time at which the option starts, this is useful for the forward starting options
2.  Normaldist 
3.  VolSurface 
 
So, what I have to do is to focus on MY files, trying not to change too much the other ones. 
 
Some of the problems I had:
 
* When I compiled the code and had tests on main I got many errors saying there were undefined reference methods. 
* It would be also helpful to get a program that reads from a .txt file all the info and builds the vol surface (enclosed is an example of how the data is).
* Black and Scholes class: 
    - It would be better to have a Newton Raphson algorithm to find the implied volatility and that the implied volatility is a method by itself. 
 
* The Black and Scholes and Vol Surf classes are supposed to call the yieldcurve class to use the interest rates for the valuation of the asset. Even though I was working at the beginning with time and expiration as doubles, I prefer to have actual dates: MMDDYYYY as appears in the date class. There might be also methods in the class that use the time as doubles in case we need it but for building the volatility surface I think it's more useful to have the actual calendar date (date and calendar have some useful functions that do that but it's good that BlackScholes and VolSurf classes incorporate those methods in case the user inputs time and expiration as doubles). 
I didn't really understand my friend's code for calendar and date classes but there are some good examples in main. 
 
For the volatility surface, I wanted to apply a quadratic interpolation, so I called the interpolation class. There is an example in main:
 
INT.SetSpline(2,0) -> This is the default case for that quadratic interpolation
 
Please include tests in main to check that the code runs correctly and also to make sure I understand how it works. 
 
According to the project, the volatility object should offer the following methods
Variance (S, K, t) variance at time t for underlying S, strike K
Volatility(S, K, t) volatility at time t for underlying S, strike K
Forward Volatility (S, K, t, T) volatility at time t (time t from now) and period T (expiration) for underlying S, strike K
 
Plots of the volatility surface that offer the option of the specific date (i.e. monthly expirations from Dec2010 until Mar2012) or T=0 to T=2 years from today and specific strikes (ie K= 180, K = 200, etc) or (from S/K=0.3 to S/K=2)
 
If you think my BlackScholes and volSurf should be redesigned and changed drastically, please feel free to do it as long as I can understand the code and it's not very advanced for me to understand it. The best thing is to be able to have a matrix or a vector of vectors that my classmates can call if they need the Volatility(S,K,T). In case we agree on the price, design and deadline. Let me know if you need to change files other than 1,2,3.
 
I'm sorry if the explanation was too long, but in the end I think it wouldn't be that complex if I was better at programming on C++. 

computer science assignment



you wrote the function words() which chops a sentence
into words and stores them into a 2D char array.
In this homework, you are required to write a function that takes a
string as its input, chops the sentence into words, and for each
word, capitalizes the rst letter and forces all other letters to be
lower case. Fox example, if the input parameter is `this is an
american TRADITION', the return value of your function should
be a valid 2D char array:
This
Is
An
American
Tradition
Your function will call words(), and the words() function can be
found on P. 283 of your textbook. Submit 3 les: words.m, your
function le, and a driver program that has input() function to get
input sentence from user.

computer science assignment


Please have someone to write a DETAIL step by step solution with solution and explanation. Thank You
Lab: 
Part A: Video Game Player Program
Step 1: Requirements
Write a program to do the following.  In main declare a Player Name Array and a Score Array.  Declare the size of the arrays to be 100.  In the InputData function input the player name and score into the arrays for an unknown number of players up to 100.  In the DisplayPlayerData function display the name and score of each player.  In the CalculateAverageScore function calculate the average score and return it by value.  In the DisplayBelowAverage function display the name of the player and score for any player who scored below the average.  Do not use global variables.  
Output from Program: 
Enter Player Name (Q to quit): Bob
Enter score for Bob: 3245
Enter Player Name (Q to quit): Sue
Enter score for Sue: 1098
Enter Player Name (Q to quit): Dave
Enter score for Dave: 8219
Enter Player Name (Q to quit): Pat
Enter score for Pat: 3217
Enter Player Name (Q to quit): Q   
Name   Score
Bob        3245
Sue        1098
Dave       8219
Pat        3217 
Average Score: 3944.75 
Players who scored below average   
Name    Score
Bob        3245
Sue        1098
Pat        3217
Press any key to continue . . . 
Step 2: Processing Logic
Using the pseudo code below, write the code that will meet the requirements:  
Main Function   
Declare the player name and score arrays, number of players, and average score.    
Call the InputData function   
Call the DisplayPlayerData function   
Call the CalculateAverageScore function and assign the returned value in average score   
Call the DisplayBelowAverage function  
InputData function    
While the number of players is less than the length of the array        
Prompt for the player's name        
If the user entered Q, break out of the loop        
Prompt the user for the player's score         
Add 1 to the number of players    
End-While 
DisplayPlayerData function    
Display the name and score of each player  
CalculateAverageScore function    
Add up the scores and divide by the number of scores to calculate the average score    
Display the average score    
Return the average score to main 
DisplayBelowAverage function    
Display the names and scores of all players who scored below the average score 
Step 3: Create a new project
Create a new project and name it LAB5A. 
Write your code using the Processing Logic in Part A Step 2.  Make sure you save your program.
Step 4: Compile and Execute
a)    Compile your program.  Eliminate all syntax errors.  
b)    Build your program and verify the results of the program.  Make corrections to the program logic if necessary until the results of the program execution are what you expect. 
Step 5: Print Screen Shots and Program

1.    Capture a screen print of your output [Do a PRINT SCREEN and paste into an MS Word document.]
2.    Copy your code and Paste it into the same MS Word document that contains the screen print of your output.
3.    Save the Word Document as Lab05A_LastName_FirstInitial    
END OF PART A
 
    


Part B: Pig Latin
Step 1: Requirements
Write a program that will input a phrase and convert it to pig latin.  Put each word in a separate element of a string array.  Remove the first letter from each word and concatenate it to the end of the word followed by "ay".         
Sample Output from Program: 
*** You will be prompted to enter a string of  ***
*** words. The string will be converted into   ***
*** Pig Latin and the results displayed.       ***
*** Enter as many strings as you would like.   *** 
Enter a group of words or ENTER to quit: DeVry is a wonderful school 
Original words: DeVry is a wonderful school
New Words: eVryDay siay aay onderfulway choolsay 
Enter a group of words or ENTER to quit: The Cowbows are going to the Superbowl 
Original words: The Cowbows are going to the Superbowl
New Words: heTay owbowsCay reaay oinggay otay hetay uperbowlSay 
Enter a group of words or ENTER to quit: 
Step 2: Processing Logic
Using the pseudo code below, write the code that will meet the requirements.  
Main function    
Display the heading    
While the condition is true            
Prompt the user for group of words or Enter to quit            
Display original words            
Call function pigLatinString( )    
End while 
pigLatinString( ) function    
Declare and initialize string variables len, counter, start, begin, word and newString    
While condition is true            
Call find() and pass a space and start as parameters and return the returned value            
to start            
if start equals to string::npos            
jump outside the loop permanently            
call substr() function            
display the word            
update newString            
increment start by one            
assign start to begin   
End While
Call substr()
Update newString
Return newString 
Step 3: Create a new project
Create a new project and name it LAB5B. 
Write your code using the Processing Logic in Part B Step 2.  Make sure you save your program.
Step 4: Compile and Execute
a)    Compile your program.  Eliminate all syntax errors.  
b)    Build your program and verify the results of the program.  Make corrections to the program logic if necessary until the results of the program execution are what you expect. 
Step 5: Print Screen Shots and Program

1.    Capture a screen print of your output [Do a PRINT SCREEN and paste into an MS Word document.]
2.    Copy your code and Paste it into the same MS Word document that contains the screen print of your output.
3.    Save the Word Document as Lab05B_LastName_FirstInitial    
END OF LAB

computer science assignment


Design a simple sequence detector to output a 1 whenever a combination of 0110 is encountered in the input sequence.

what will be the moore and mealy machines for this?

computer science assignment


Describe and analyze an algorithm that decides, given any two binary trees P and T, whether P equals a subtree of T. [Hint: First transform both trees into strings.]

computer science assignment


Now write a second client program in a file named Collisions.java. This program should simulate two particles moving in space. Its goal is to determine the number of times the two particles collide (occupy exactly the same position after the same number of steps -- the steps could be thought of as simulating time). We'll assume the particles are in a very large space so use a large number for the boundary (such as 2,000,000). Use 100,000 for the maximum number of steps. (Don't enter the commas.) Start one particle at (-3, 0) and the other at (3, 0). (You can hardcode these values into the program; no need to enter them.) Your program should contain a loop that has each particle take a step as long as the particles have not exceeded the maximum number of steps. The program then determines how often the particles have collided. Note that in order for your program to know whether or not the two different RandomWalk objects are in the same place it needs to be able to find out the position. Hence, you need to add the following two methods to the RandomWalk class.

a. int getX() - returns the x coordinate of the current position

b. int getY() - returns the y coordinate of the current position

c. Compile and run your program to make sure it works. As before run it several times.

10. In your Collisions.java program the condition to determine if the points are at the same position is a bit cumbersome. This is something that would be best put in a separate method. Add a static method to Collisions.java (after the main method) with signature public static boolean samePosition (RandomWalk p1, RandomWalk p2)

a. The method should return true if p1 and p2 are at the same position and return false otherwise. Modify your main method so it calls samePosition rather than directly testing to see if the objects are at the same position. Test the program.

11. In using random walks to simulate behavior it is often of interest to know how far away from the origin the object gets as it moves.

a. Add an instance variable maxDistance (type int) to the RandomWalk class. This should be set to 0 in each constructor.

b. Now the takeStep method needs to update this maximum when a step is taken. We'll add a support method to the class to do this. Add a private method named max that takes two integer parameters (say num1 and

b. num2) and returns the largest of the two.

c. Add code to takeStep to update maxDistance. This can be done in a single statement using the max method -- the new value of maxDistance should be the maximum of 1) the old value of maxDistance, and 2) the current distance to the origin. Note that if the current point is (-3, 15) the distance to the origin is 15; if the current point is (-10, 7) the distance to the origin is 10. Remember that Math.abs returns the absolute value of a number.

d. Finally add an accessor method to return that distance so a client program can access it:

c. public int getMaxDistance()

e. Test the maximum by adding statements in TestWalk.java to get and print the maximum distance for each of the objects after the loop that had them take and print out 5 steps (this way you can see if the maximum is correct – each step is printed).