Welcome! Log In Create A New Profile

Advanced

Help with assignment questions

Posted by SupaSain 
Announcements Last Post
Announcement myUnisa availability 21 to 24 March 2019 03/17/2019 02:24PM
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Help with assignment questions
April 13, 2008 10:07AM


Hi can anyone send me the questions to assignent 2 of this module. I am in a lurch until i get the book. Thanx
Re: Help with assignment questions
April 29, 2008 01:50PM
Hi,
You can download Tutorial 101 from my.unisa.ac.za
Re: Help with assignment questions
May 08, 2008 10:05AM
Can anybody assist with Assignment 03 question 3.4, When iam using neested if statements it only execute the last statement and the rest are ignored, When i try to use a case statement which is the best to use for this problem..the matter is how to make a radiobutton a case statement while not using a radiogroup????
Re: Help with assignment questions
May 08, 2008 11:19AM
question 3.4 is: What is the index value of the first item in a ListBox?

also question 3 does not contain radio buttons. surely you are referring to a different question?
Re: Help with assignment questions
May 09, 2008 11:32AM
Sorry!! i meant to say assignment 3 question 1.4

thanx...
Re: Help with assignment questions
May 09, 2008 12:07PM
still there is no radio buttons.

are you using separate if statements or nested else if statements?

in the case statement you can check for multiple values

case letter of
      'a','b','c' : <statement>;
Re: Help with assignment questions
May 09, 2008 02:37PM
I used nested else-if statement, i will try to use if statement and i will let you know how it went. for now enjoy your weekend Randal..
Re: Help with assignment questions
May 12, 2008 05:13PM
Hi Randal!

a feedback of question 1.4 i managed to get it right, i used nested else-if statement with and-not statement.

But i have another problem with question 3.1 it confuses where i have to delete a vowel from a string and display it in the ListBox.
How can u delete a vowel from a string....?
Re: Help with assignment questions
May 13, 2008 05:07PM
Delete(S, I, C)

where S is your string to search, I is the position in the string to do the delete, and C is the number of characters to delete
Re: Help with assignment questions
May 14, 2008 09:10AM
I did use a Delete command but is not deleting a character,it deletes the whole string. I think is because of a for loop statement that are used. Alternatively i used Pos() command and still is not doing what i want. Please check my codings below and tell me what is it i'm doing wrong..

procedure TfrmStrings.btnTransferModifyClick(Sender: TObject);
var
word: string;
vowel: char;
i: integer;
begin
word:= edtWord.Text;
i := Pos(' ', word);
if(vowel = 'a') or (vowel ='e') or(vowel ='i') or (vowel ='o')or (vowel ='u')
or(vowel ='A')or(vowel= 'E')or(vowel = 'I')or (vowel = 'O')or(vowel = 'U')then
vowel := word;
lstModify.Items.Add(word);
Re: Help with assignment questions
May 14, 2008 09:54AM
well, in your code you have no loop. also your code does not modify word in any way. you test the value of vowel without setting its value first and you give i the value of this position in the string that is '' then you assign word to vowel.

Sorry to say, but your code is all mixed up. I suggest you delete everything between begin and end of the procedure and start over.

try loop from the last letter in the string to the first letter

for i := Length(word) downto 1

then in each iteration evaluate the letter of the string

string

if the letter is a vowel, use delete to remove it from the string

Delete(string, i, 1)
Re: Help with assignment questions
May 16, 2008 10:25AM
Thanx again Randal!!

I managed 2 get it right
Re: Help with assignment questions
May 16, 2008 10:28AM
cool
Sorry, only registered users may post in this forum.

Click here to login