Thread: [HELP] I can not do this program

  1. #1
    Registered User
    Join Date
    Nov 2016
    Posts
    1

    [HELP] I can not do this program

    Follow ...


    "The mosquito outbreak control program is software that should help (but very little) the public health secretariat of a municipality to maintain a record of mosquito breeding sites (such as standing water) and to be able to make decisions Of combat. This control is important, especially in times of zika and chikungunya, that we are not even aware of its consequences on our health. The program shall maintain a register of all known foci in any region of the city, represented by geographical coordinates (x, y) - suppose to be latitude and longitude - and a description (eg "plant pot" "Water tank", etc.). At any time, the program should allow the consultation of foci close to some geographic coordinate (x, y) provided by the user. In addition, the program should also allow consultation of how many foci of a given type have been registered, for example, how many foci of "plant pot".


    Step 1: Each record will be represented by a geographic coordinate (x, y) and a description of the type of focus. The coordinates must be integers, for example: (1, 0), (2, 3), (5, 4), (10, 4), etc. The description should be a text that explains the nature of the record, such as "standing water" or "garden", for example. For this step, define the structure that will store all of this data. Also declare the array that will store each of the records. Note that the size of this array will contain the maximum number of records that the program will store (choose this limit). Also, be sure to declare a variable that is currently indexed and currently logged in.

    Step 2: One of the features of the program is the query for records close to some coordinate provided by the user. For example, when querying the coordinate (2, 2) the program should search for records with a close coordinate, for example (1, 2) or (3, 2). To calculate the distance from one coordinate to another, simply use the distance between two points: d = root (x2-x1) ² + (y2-y1) ². Define a symbolic constant that indicates the maximum allowed radius for two points to be considered close. For example, if this radius is set to 5, any two points whose distance d is less than or equal to 5 are considered to be close and should appear in that query. For this step, just create a function that returns the distance between two points: this function must receive the coordinates of the points as parameters and produce a real value with the distance between them.

    Step 3: Your program should be a menu driven program. The menu options should be: "Register occurrences", "List occurrences", "Query occurrences by region", "Generate occurrence report by type" and "Exit". Implement the basic operating scheme of your program: use an infinite loop in the main () function and a function to display the menu.

    Step 4: Record of occurrences. Define a function that indefinitely reads the coordinates and descriptions of occurrences until the coordinate (0, 0) is entered.

    Step 5: List occurrences. Develop a function that lists all occurrences with their coordinates and descriptions.

    Step 6: Check occurrences by region. Develop a function that takes a coordinate (x, y) as a parameter and lists all occurrences that are registered next to it. To calculate the distance, use the function and the symbolic constant defined in Step 2. Before calling the function, ask the user which coordinate you want. Then, pass this coordinate as a parameter to the function you created and verify in each record the distance of the coordinate passed with the registered coordinate; If this value is less than or equal to the radius, this record should be displayed on the screen.

    Step 7: Generate occurrence report by type. Create a function that shows a report on the screen, capriche a bit in the view. This function should be parameterized as a string with a description of the type of occurrence being searched, for example "standing water".The report should show the following information: • Total occurrences of the desired type - the total sum of all occurrences of the desired type. Create a function that returns this value • The percentage of occurrences of the desired type in relation to total occurrences. Create a function that returns this value • The information for each occurrence of the type you want.

    Step 8: Increase the function of one of the previous steps (Step 6 or Step 7) to, in addition to displaying the information on the screen, also create a text file with the same information.

    Sorry for the bad English, I am Brazilian and not fluent in English.
    Last edited by ipablo7; 11-28-2016 at 12:57 PM.

  2. #2
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    Please refer to the homework policy.

    Before you worry about any writing code, break down the problem statement and come up with a list of discrete requirements. Then figure out what your program needs to do, and come up with lists of steps for each thing. Develop your logic and program flow, then begin translating this information into code.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 7
    Last Post: 03-15-2016, 06:35 AM
  2. Replies: 4
    Last Post: 12-21-2015, 07:17 AM
  3. Replies: 2
    Last Post: 09-09-2014, 02:36 PM
  4. Replies: 2
    Last Post: 12-11-2012, 12:25 AM
  5. Replies: 1
    Last Post: 03-03-2009, 04:47 PM

Tags for this Thread