Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Is there anyway I can improve this flow chart? I've attached the needed pictures below Welcome the user Print an explanation message what the program

Is there anyway I can improve this flow chart? I've attached the needed pictures below

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Welcome the user Print an explanation message what the program does Ask the user to enter the size of the population and generate it Create a loop with the six decisions the user could take Ask the user to choose an option Option 1 5 2543 ( po Fel Take the ID of the first Allen Use the given formula and print the answer If they are both Males or Females= No Mate Mate two compAliens Note Take the ID of the second Alien ni I cal Option Ta cal ca SE Randomly Mate a pair of compAliens Take the OH amount of the O pairs Randomly generate two pairs for the amount entered Use the given formula and print the answer Print a name that is atleast Ask the user to enter the size of the population and generate it Create a loop with the six decisions the user could take Ask the user to choose an option Option 1 5125 Take the ID of the first Alien HO if they are both Males o Females No Mate Use the given formula and print the ansver Mate two compAliens Note Take the ID of the second Alien Option 2 Randomly Mate a pair of compAliens Take the o amount of the O- pairs Randomly generate two pairs for the amount entered Use the given formula and print the answer Print and that is at 3 letters maximus letter Print the results for every Alien generate one of the seven known colors Colors of the Aliens nu L 5 Option Ask the user to enter the size of the population and generate it Ask the user to choose an option Option 3 2543 Calculate the population of Females and Males Print the statistics Show statistics Take the number of health to calculate the statistics Option Take a string Color to calculate the population of same color entered mly e two or the int ed Use the given formula and print the answer Generate names for the population Print a name that is atleast 3 letters and maximum 8 Use an array that holds letters from "A" to "Z" letters Colors of the Aliens Generate a number that's between 3 and 8 5 Option compAlien: Genetics Simulation Consider an alien species (life form called compAlien, whose genetic material is coded by three characters: 'X', 'Y','Z'. An individual of this species has a code length of 128 and made up of these three characters. A compAlien may have the following genetic code having length of 128 characters: X Y x 22 There are certain properties of this species, which can be identified by analyzing the genetic code: - Health: An individual's health is proportional to the number of distinct "YXZ sequences in its code. Health affects the individual's chance of producing offsprings. - Gender: gender is determined by the last (128th, character: males have 'Y'; females have 'X' or 'Z' on their code as the last character. - Reproduction: When two individuals of opposite gender mate, they can produce an offspring with a probability proportional to the sum of their healths. The probability of having an offspring for two opposite gender individuals X and Y is formulated as follows: p_reproduce = (Health_X + Health_Y) / N Experiment on N to find an appropriate value for reproduction probability. Remember a probability can be 0 and 1 and can be represented as a percentage. Your task in this project is to write a main program and related methods to simulate the above described compAlien species and it lifecycle. Your program must have at least 6 methods (main, generateGeneticCode, calculate Health, findGender, and reproduction Result, etc.) In your program - Ask user to enter the size of the population of compAlien species ... Generate given number of individuals of compAlien species - Calculate their healths and find their genders - Assign ID to cach pair starting from 1 - Show the following options to the user: Mate two compAliens: user can enter the IDs of two compAliens to mate them. Show the result of reproduction Randomly enlarge population: ask user to enter number of randomly chosen compAlien pairs and simulate their reproduction. Calculate statistics: find number of females and males, find number of compAliens having health of ! a user given number) or higher, and add other interesting statistics (i.c. some specific gene orders may represent some illnesses, some genes at specific locations can represent some physical characteristics such as eye color, hair color etc.). You are free to add other properties (at least two more operations in order to make your program more interesting Hint: During the development you can choose a smaller size for genetic code, e.g. 12, to trace and debug the program easier. You will use String class and create an array to generate the population. Example output: Enter the size of compAlien population: 71 Simulating compAlien species... ID:1, Female, Health: 4 ID:2, Female, Health: 1 ID:3, Male, Health: 3 ID: 71, Male, Health: 8 compAlien population is generated! Choose an options: (1) Mate two compAliens (2) Randomly mate a set of compAliens (3) Show statistics (4) Your other option-1 (5) Your other option-2 Enter an option: 1 Mating two compAliens Enter ID of first compAlien: 13 Enter ID of second compAlien: 28 compAlien 13(M) and 28(M) Mate: no mate Choose an options: (1) Mate two compAliens (2) Randomly mate a set of compAliens (3) Show statistics (4) Your other option-1 (5) Your other option-2 Enter an option: 1 Mating two compAliens Enter ID of first compAlien: 13 Enter ID of second compAlien: 32 compAlien 13 (M) and 32 (F) Mate: Offspring chance 67%. They have 1 offspring :) no mate. Choose an options: (1) Mate two compAliens (2) Randomly mate a set of compAliens (3) Show statistics (4) Your other option-1 (5) Your other option-2 Enter an option: 2 Simulating Random compAlien Reproduction Enter number of compAlien pairs to reproduce: 4 Alien 1 (F) and 5 (M) mate: Offspring chance 673. Result: 1 Offspring Alien 2(M) and 5(F) mate: Offspring chance 5%. Result: no Offspring Alien 1 (F) and 7(F) mate: no mate Alien 3 (M) and 9 (M) mate: Choose an options: (1) Mate two compAliens (2) Randomly mate a set of compAliens (3) Show statistics (4) Your other option-1 (5) Your other option-2 Enter an option: 3 compAlien Population Statistics FEMALE population = 55% MALE population = 45% Enter an health threshold [between - and -]: 12 38% of compAlien population have an health of 12 or higher //Add other intersting statistics Choose an options : (1) Mate two compAliens (2) Randomly mate a set of compAliens (3) Show statistics (4) Your other option-1 (5) Your other option-2 Enter an option: 4 Welcome the user Print an explanation message what the program does Ask the user to enter the size of the population and generate it Create a loop with the six decisions the user could take Ask the user to choose an option Option 1 5 2543 ( po Fel Take the ID of the first Allen Use the given formula and print the answer If they are both Males or Females= No Mate Mate two compAliens Note Take the ID of the second Alien ni I cal Option Ta cal ca SE Randomly Mate a pair of compAliens Take the OH amount of the O pairs Randomly generate two pairs for the amount entered Use the given formula and print the answer Print a name that is atleast Ask the user to enter the size of the population and generate it Create a loop with the six decisions the user could take Ask the user to choose an option Option 1 5125 Take the ID of the first Alien HO if they are both Males o Females No Mate Use the given formula and print the ansver Mate two compAliens Note Take the ID of the second Alien Option 2 Randomly Mate a pair of compAliens Take the o amount of the O- pairs Randomly generate two pairs for the amount entered Use the given formula and print the answer Print and that is at 3 letters maximus letter Print the results for every Alien generate one of the seven known colors Colors of the Aliens nu L 5 Option Ask the user to enter the size of the population and generate it Ask the user to choose an option Option 3 2543 Calculate the population of Females and Males Print the statistics Show statistics Take the number of health to calculate the statistics Option Take a string Color to calculate the population of same color entered mly e two or the int ed Use the given formula and print the answer Generate names for the population Print a name that is atleast 3 letters and maximum 8 Use an array that holds letters from "A" to "Z" letters Colors of the Aliens Generate a number that's between 3 and 8 5 Option compAlien: Genetics Simulation Consider an alien species (life form called compAlien, whose genetic material is coded by three characters: 'X', 'Y','Z'. An individual of this species has a code length of 128 and made up of these three characters. A compAlien may have the following genetic code having length of 128 characters: X Y x 22 There are certain properties of this species, which can be identified by analyzing the genetic code: - Health: An individual's health is proportional to the number of distinct "YXZ sequences in its code. Health affects the individual's chance of producing offsprings. - Gender: gender is determined by the last (128th, character: males have 'Y'; females have 'X' or 'Z' on their code as the last character. - Reproduction: When two individuals of opposite gender mate, they can produce an offspring with a probability proportional to the sum of their healths. The probability of having an offspring for two opposite gender individuals X and Y is formulated as follows: p_reproduce = (Health_X + Health_Y) / N Experiment on N to find an appropriate value for reproduction probability. Remember a probability can be 0 and 1 and can be represented as a percentage. Your task in this project is to write a main program and related methods to simulate the above described compAlien species and it lifecycle. Your program must have at least 6 methods (main, generateGeneticCode, calculate Health, findGender, and reproduction Result, etc.) In your program - Ask user to enter the size of the population of compAlien species ... Generate given number of individuals of compAlien species - Calculate their healths and find their genders - Assign ID to cach pair starting from 1 - Show the following options to the user: Mate two compAliens: user can enter the IDs of two compAliens to mate them. Show the result of reproduction Randomly enlarge population: ask user to enter number of randomly chosen compAlien pairs and simulate their reproduction. Calculate statistics: find number of females and males, find number of compAliens having health of ! a user given number) or higher, and add other interesting statistics (i.c. some specific gene orders may represent some illnesses, some genes at specific locations can represent some physical characteristics such as eye color, hair color etc.). You are free to add other properties (at least two more operations in order to make your program more interesting Hint: During the development you can choose a smaller size for genetic code, e.g. 12, to trace and debug the program easier. You will use String class and create an array to generate the population. Example output: Enter the size of compAlien population: 71 Simulating compAlien species... ID:1, Female, Health: 4 ID:2, Female, Health: 1 ID:3, Male, Health: 3 ID: 71, Male, Health: 8 compAlien population is generated! Choose an options: (1) Mate two compAliens (2) Randomly mate a set of compAliens (3) Show statistics (4) Your other option-1 (5) Your other option-2 Enter an option: 1 Mating two compAliens Enter ID of first compAlien: 13 Enter ID of second compAlien: 28 compAlien 13(M) and 28(M) Mate: no mate Choose an options: (1) Mate two compAliens (2) Randomly mate a set of compAliens (3) Show statistics (4) Your other option-1 (5) Your other option-2 Enter an option: 1 Mating two compAliens Enter ID of first compAlien: 13 Enter ID of second compAlien: 32 compAlien 13 (M) and 32 (F) Mate: Offspring chance 67%. They have 1 offspring :) no mate. Choose an options: (1) Mate two compAliens (2) Randomly mate a set of compAliens (3) Show statistics (4) Your other option-1 (5) Your other option-2 Enter an option: 2 Simulating Random compAlien Reproduction Enter number of compAlien pairs to reproduce: 4 Alien 1 (F) and 5 (M) mate: Offspring chance 673. Result: 1 Offspring Alien 2(M) and 5(F) mate: Offspring chance 5%. Result: no Offspring Alien 1 (F) and 7(F) mate: no mate Alien 3 (M) and 9 (M) mate: Choose an options: (1) Mate two compAliens (2) Randomly mate a set of compAliens (3) Show statistics (4) Your other option-1 (5) Your other option-2 Enter an option: 3 compAlien Population Statistics FEMALE population = 55% MALE population = 45% Enter an health threshold [between - and -]: 12 38% of compAlien population have an health of 12 or higher //Add other intersting statistics Choose an options : (1) Mate two compAliens (2) Randomly mate a set of compAliens (3) Show statistics (4) Your other option-1 (5) Your other option-2 Enter an option: 4

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

New Trends In Databases And Information Systems Adbis 2019 Short Papers Workshops Bbigap Qauca Sembdm Simpda M2p Madeisd And Doctoral Consortium Bled Slovenia September 8 11 2019 Proceedings

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Robert Wrembel ,Mirjana Ivanovic ,Johann Gamper ,Mikolaj Morzy ,Theodoros Tzouramanis ,Jerome Darmont

1st Edition

3030302776, 978-3030302771

More Books

Students also viewed these Databases questions