logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

this assignment is to implement the Collatz sequence explorer we implemented an algorithm which computes each value in the sequence

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Overview

The goal of this assignment is to implement the Collatz sequence explorer. We have already seen the Collatz sequence in Assignment 1, where we counted the number of elements in the sequence. To do this, we implemented an algorithm which computes each value in the sequence and counts how many there are. For this assignment, in addition to counting them, you are also expected to output each value and its position (or count) in the sequence on the liquid crystal display (LCD).

The initial starting value for the sequence will be obtained from the user via the buttons on the LCD Shield (as described in Specifications below). Upon user confirmation, the device should display the initial value, whatever it is, and its count of 0 at the designated locations on LCD. After a short time-delay, the device will advance to the next value and display its corresponding count of

  1. The value and its count will continue advancing with a predetermined time- delay between them until the value reaches 1, at which point the last value and its count will remain on the screen until the user selects another value. The time-delay period will be chosen by the user, as described in Specifications below.

While the Collatz sequence is advancing on the screen, the user should be able to continue to interact with the input prompt using the LCD shield buttons. At any time, when the user changes the speed setting, the time-delay should be adjusted accordingly and immediately. Similarly, when the user changes the starting value and confirms the selection, immediately upon confirmation, the sequence display will update with the new starting value and start advancing from there.

This assignment is composed of several sub-problems that can be completed and tested separately before combining them into the final solution. This assignment builds on the previous assignments and labs. You are welcome to use your own previously written code or the solutions provided to you on conneX during     this course. If you use any of the solutions from conneX, you should reference them appropriately in the comments. For example, if you copied and modified the init to string function from Lab 7, then you could say: ”This function is a modified version of the function int to string from Lab 7, CSC 230, Fall 2019” in the comments.

Specifications

•  Program start:

When the device starts, or when the reset button is pressed, the LCD  screen should display your first and last name and the phrase ”CSC 230 - Fall 2019” for a period of 1 second. Then, the screen should change to the same as shown in the picture below. The cursor should be set to the least significant digit of the initial Collatz value (“n=”). The speed should be initialized at 0. The initial Collatz sequence value should be initialized at  0, and its count should be initialized at 0.

• The LCD screen layout:

 

 

n

=

0

0

0

*

 

 

 

S

P

D

:

0

 

c

n

t

:

 

 

0

 

v

:

 

 

 

 

 

0

The input fields are highlighted using boldface.

 

  • Top row is designated for prompting the user for the

    • The first three digits (initialized as zeroes), which are next to the ”n=”, are designated for inputting the new starting value of the Collatz sequence to be These digits are updated one at a time when the cursor is on each of them and the user presses UP or DOWN buttons on the LCD shield. For example, if the cursor is on the first of the three digits and that digit is currently showing as ”5”, pressing UP will change it to ”6”. This initial starting value could range between 0 and 999.

    • The asterisk (*) is for confirming the starting value for the new

Collatz sequence. When the cursor is on the asterisk and the user presses UP or DOWN, the current value and its count will be updated immediately to the new value and its initial new count of zero. Then it will continue advancing (or not) according to the current speed setting.

  • The last digit (also initialized as zero), which is next to the ”SPD:” is for controlling the amount of time to wait before

advancing to the next value in the given Collatz sequence. This speed digit is updated when the cursor is on it and the user presses UP or DOWN in a similar fashion as the first three digits described above. This speed value could range between 0 and 9.

 

  • Bottom row is designated for displaying the current value and its count in the given Collatz

    • The numbers are periodically updated to the next value and its count based on a user-determined time-delay

  • The time-delay between advances to the next value is deter- mined by speed value, which is displayed in the first row of the LCD screen and explained further

  • The maximum possible count could be 3 decimal digits long

and the maximum possible value could be 6 decimal digits long, hence the corresponding space provided between “0” and “:” on the second row in the picture above.

Suggestion: Store two strings of length 171 in memory and periodically update the LCD with those strings (lcd puts function). To change the message being displayed, update these strings (e.g. via ISR), and not the LCD, as it will get updated as per previous sentence.

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

722 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

924 Answers

Hire Me
expert
Husnain SaeedComputer science

816 Answers

Hire Me
expert
Atharva PatilComputer science

856 Answers

Hire Me

Get Free Quote!

333 Experts Online