Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 Pseudocode - Initialization understanding, requesting help - a noob in programming

views
     
TSGon Freaks
post Feb 18 2025, 03:28 PM, updated 11 months ago

Casual
***
Junior Member
387 posts

Joined: Jul 2005
Hi Everyone,

Hope you are doing well. in health and wealth.

anyway, just wanted to get some idea on the Initialization setup for Psuedocode.

If there are a couple of input requirements, should it be stated in the initialization section based on the sequence?

eg;

a program to calculate game platform, game price, payment method and maybe game type (physical/digital)

so should there be a sequence on which should be first in the initialization? will it be based on the flowchart process? if there is a gap between the requirement of input. does it mean that we need to split the initilization between process?

eg: select item ---> select item color ----> calculate price ----> apply discount ----> select location ----> calculate total cost. ---> select payment method ---End

so in the example above; the initialization is

Input Item

Input item color

Input location

Input payment method.

but since input location and payment method is not required in the earlier process (anything before calculating the prices process), should the initialization be split into 2 segments?

some like this.

Begin

Initialization
SET item_price = INPUT “Enter the item ”

SET color_tag = INPUT “Enter the item color tag (Blue, Red, Green,): ”

Calculate Price. ----> Apply discount

Initialization

Set location = INPUT "Location for delivery"

Set payment method = INPUT "payment method"

Or we can just prepare everything in the first initialization section without any issues?

Appreciate the help on this.

Thanks!!!
SUSipohps3
post Feb 18 2025, 04:03 PM

Regular
******
Senior Member
1,974 posts

Joined: Dec 2011



ChatGPT Grok DeepSeek Claude Gemini Qwen semua tu kan ada
TSGon Freaks
post Feb 18 2025, 04:53 PM

Casual
***
Junior Member
387 posts

Joined: Jul 2005
owh, cannot get human touch anymore?
ragk
post Feb 18 2025, 07:09 PM

BooBoo~
*******
Senior Member
2,354 posts

Joined: Apr 2009


Depends, is the location and payment info sharable by other process?
If it is, yes u can have it on initialization, and keep it as singleton, so the later action will always grab if from the same cache.
But if it's vary by user input or data, then it's better to only load it when necessary, which is later stage.

For example, let say if the location and payment took 2 seconds to load.
In singleton case, only the first load (maybe during system startup) u spend 2 seconds for the initialization, thn once and for all, all the transaction later will save the 2 seconds loading time.
But if it have to be load later due to design, thn only load it when necessary, u don't want the 2 seconds kick in everytime user access the page, user might not even enter into the later stage, generally in programming it's best to avoid loading what's not needed yet for better user experience

This post has been edited by ragk: Feb 18 2025, 07:11 PM
meng6
post Feb 18 2025, 08:25 PM

Getting Started
**
Junior Member
63 posts

Joined: Aug 2020
QUOTE(ipohps3 @ Feb 18 2025, 04:03 PM)
ChatGPT Grok DeepSeek Claude Gemini Qwen semua tu kan ada
*
Genius answer lol.gif

 

Change to:
| Lo-Fi Version
0.0166sec    0.60    5 queries    GZIP Disabled
Time is now: 23rd December 2025 - 09:09 AM