Program to spider''s path display to the screen, C/C++ Programming

Assignment Help:

Spider webs have two types of silk, sticky silk and strength silk, spiders do not move on the sticky silken threads only on the strength threads. Assume one type of spider creates webs such that the strength silks radiate form the center like bicycle spokes and the sticky threads are like concentric circles.

The strength webs are numbers 0 through n  in a clockwise fashion, starting at the "12 o'clock" position, these webs are equally spaced, the sticky webs are designated by sequential letters of the alphabet starting with A on the inner most circle. Write a code that accepts user input for the number of strength webs and a number of sticky webs and the number of flies that have been trapped. Generate the web then place the spider as shown (no graphics required). Randomly place the flies on the web. Have  your spider's path display to the screen. If the fly is closer to one strength web or the other then that should be the spider's  destination, else  it does not matter. Once a fly  is captured then the spider should travel to the next fly until all are captured.

Sample run: Input> 8

Input>  4

Input >I

Spider at  7, 0

Fly F  near 4, D.

(8 strength webs) (4 sticky circles) (1 fly)

(meaning it is on strand 7 but outside the sticky webs)

Spider travels to 7, D Spider travels to 7, C Spider travels to 7, B Spider travels to 7, A Spider travels to center Spider travels to 4, A Spider travels to 4, B Spider travels to 4, C Spider travels to 4, D Fly captured.


Related Discussions:- Program to spider''s path display to the screen

Friendly function and rules of friend function, F r i e n dly Function...

F r i e n dly Function: A class can have public members and private members.   The public member can be used through the class using dot operator.   Where as private me

Car rental project, I need a project on car rental system using c programmi...

I need a project on car rental system using c programming only of college level

Define bitwise-and operator, Define Bitwise-AND Operator: &:? The bitwi...

Define Bitwise-AND Operator: &:? The bitwise-AND operator (&) compares every bit of its first operand to the corresponding bit of its second operand. If both bits are 1 the mat

Project (network programming), Need help in network programming in C++ proj...

Need help in network programming in C++ project. How much you charge?

I need asp .net facebook app project completion, I need Asp .net Facebook a...

I need Asp .net Facebook app project completion Project Description: We are urgently seeking a few remaining items to be completed, and the project to be deployed to live.

Palindrome, Problem : Change to palindrome A palindrome is a string that r...

Problem : Change to palindrome A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your ta

Structure of cpp program, Structure of C++ Program: Chronological orde...

Structure of C++ Program: Chronological order of C++ program. 1.   Class declaration 2.   Main function program 3.   Member functions definitions 4.   Include heade

Solution, Damjibhai and Shamjibhai are two jeweler friends. They decide to ...

Damjibhai and Shamjibhai are two jeweler friends. They decide to play a simple game. The game comprises of removing the jewels for polishing, turn by turn. Once a jewel is removed

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd