Basic Programming Course: Lesson #2

in #devjr-s20w24 hours ago (edited)

Screenshot_20240919-075424.png

Black Gold Elegant Jewelry Logo_20240919_081650_0000.png
edited with canva

Hello friends and I gladly welcome you all to this great edition of SEC: S20/W2 in this great community. I would love to thank @alejos7ven I would be sharing my thoughts on the challenge.


"What are variables and what are they used for"

In the world of technology and basically in the statistics, variables are highly crucial in putting together special data, which when their commands are executed the bring forth solutions to real-life problems, they could bring changes to people's life, making life easier and stress free. Statistics help variables to identify various parameters for each specific function.

Moreso, the great analogy used in the lesson still interests me, the class and names scenario was a real delight and I must applaud the lecturer. These variables are special characters used to store values which would be used in solving real world problems subsequently, variables are sources of reference point, special characters which help define a context and for easy retrieval at the right time for special duties.

Variables are also specially used in programming as they store data of various parameters, when executed these variables aid in solving complicated issues and in other cases could be used in compilation of special reports in various sectors, say cryptocurrency news on a news broadcasting network. The variables displayed on the screen shows how much viewers are to know about their interest cryptocurrency.


"Assign a type of data to the following variables and explanation why, email, phone, working hours, price_steem and age."

I would be attempting the task immediately. I do hope my explanation are daly understood

Email: (Text)(character)
This is chosen as text because an email comprises of numbers, alphabet, letters and special characters too. All these synchronises to make them unarguably a text The special characters would be @and . the letters, numbers 13 would be respectively. [email protected]

Phone: (integer)
Phone number are numerical which always have about 11 numbers, they possess special characters such as + which denotes geographical zones, in other words various
countries, where the phone number is created and located. They could be termed positive integers in this context. phone_integers;

Working Hours: (integer)
It displays time, telling us the time. Time is usually a positive integers, it doesn't have a negative character, most importantly it is in the form of numbers which is best explained as an integer. working_hours_integer;

Price-steem: (Real)
The price of steem would be labelled real because it has decimal and also fluctuates due to unstable market conditions. This denotes that the real data type which stores numbers whether decimals and it could be positive or negative as the case may be. This price steem is a real variable. price_steem_real;

Age: (integer)
This is an integer data type since it is made up of numbers, it doesn't have decimals only true numbers attached to age, thus it must be called an integer Age_integer;


Explain how the following code works;

Screenshot_20240919-073111.png

I would most definitely highlight these texts, explaining in details how the code works

Algorithm names This explains to us that this special algorithm is called names

Define name, last_name as Character;
Analysing this webcam see two special variables have been identified as characters because they have numbers and alphabets as seen from the text. They are called character

Print "Enter your name:";
The line of code requests the user to fill in his or her name, so as to ensure it gives the instructions Print "Enter your name:";

Read name;
This codes represent the typed name an explanation of the preceding instruction.

Print "Enter your last_name:";
This instructs the user to enter these instructions as shown
"Enter your last_name:";

Read last_name;
This instruction is a function of the displayed typed name, that was inputted based on the preceding request too.

Print "Hello " name " " last_name", welcome";
It displays Hello followed by name you entered when you were required to enter the name, then last name too when you were asked to enter it too, then displayed together with welcome.

End Algorithm:
Tells you that the algorithm has ended


Develop a pseudo-code to calculate the value in USD of XSTEEM. For this, you can rely on this algorithm.

Declare variables price_steem, total and amount_steem
Request the user for the necessary data
Calculate as follows; total= amount_steem price_steem
Show result on screen


Screenshot_20240919-074930.png

USD of STEEM Algorithms

//1. Create Variables
Define price_steem, total, amount_steem as Real

//2. Collect data
Print "Enter the price_steem:";

Read price_steem;
Print "Enter the amount_steem:";
Read amount_steem:

//3. Total Calc
total = amount_ steem*price_steem;

//4. Show results
Print "The value in USD of STEEM is " total;
End Algorithm
Screenshot_20240919-075424.png

Screenshot_20240919-075459.png

I have concluded my article and would love to invite @rafk @bossj23 @pelon53 @solaymann to join challenge

Coin Marketplace

STEEM 0.18
TRX 0.15
JST 0.028
BTC 63006.79
ETH 2456.26
USDT 1.00
SBD 2.59