Can you share exercises/assignments of programming?

  • Thread starter Thread starter shivajikobardan
  • Start date Start date
  • Tags Tags
    Programming
Click For Summary

Discussion Overview

The discussion revolves around seeking and sharing programming exercises and assignments, particularly for beginners learning JavaScript. Participants share their current learning status, resources, and specific exercises to practice programming concepts.

Discussion Character

  • Exploratory
  • Homework-related
  • Technical explanation

Main Points Raised

  • One participant expresses a desire for exercises suitable for their current level, having just learned about arrays and strings.
  • Another participant shares a design document for a RingBuffer, detailing its structure and methods, indicating a more advanced understanding of programming concepts.
  • A third participant lists various programming exercises, including functions to manipulate arrays and strings, and suggests resources for further learning.
  • Some exercises proposed include finding the largest number in an array, filtering strings by length, and identifying palindromes.
  • A later reply comments on the simplicity of the exercises for someone with prior experience, suggesting that practice is essential for improvement.

Areas of Agreement / Disagreement

Participants generally agree on the importance of practice and sharing resources, but there is a difference in opinion regarding the difficulty level of the suggested exercises, with some considering them too simple for more experienced learners.

Contextual Notes

Some exercises may depend on prior knowledge of JavaScript functions and array manipulation, and there is no consensus on the appropriateness of the difficulty level for various learners.

Who May Find This Useful

Beginners in programming, particularly those learning JavaScript, as well as educators looking for exercise ideas for students.

shivajikobardan
Messages
637
Reaction score
54
TL;DR
exercises
I've finished self-learning till arrays. Learning about strings today. My level isn't that high yet that I will be able to solve DSA problems in leetcode and codewars imo. So, I want some exercises. If some of you have access to university's assignments and are eligible to share it, please share it. Or some other exercises are also ok.
 
Technology news on Phys.org
Here is a design document I wrote for a teenager some years ago:
Design Document For RingBuffer
Basic object:
[CODE lang="c" title="RingBuffer"]Ringbuffer: Object {
private
char buf[];
int buf_size, put_on, take_off;
bool empty, full;
int init(int size);
int next(int ix);
public
int put(char ch);
int get(void);
}
[/CODE]
Design Details
init
  1. Allocate space for buf[]
  2. Set buf_size, put_on and take_off to initial values (find out)
  3. Set empty to TRUE and full to FALSE
next
return (ix+1) if ix<buf_size, otherwise return 0
put
If full
return -1
else
Copy ch to buf[put_on]
Update put_on
Set empty to FALSE
if put_on equals take_off set full to TRUE
return 0
get
if empty
return -2
else
copy buf[take_off] to temp
update take_off
Set full to FALSE
if put_on equals take_off set empty to TRUE
return temp
Constraints
The Ringbuffer module is supposed to be a part of a multi-threaded program. It cannot rely on any libraries.
 
  • Like
Likes   Reactions: shivajikobardan
Update: These are the helpful things that I found from my research.

1) Wes bos 30 days of javascript.
2) https://www.freecodecamp.org/news/javascript-projects-for-beginners/
3) Go to codewars easier challenges

Exercises:

Write a function that takes an array of numbers and returns the largest number in the array.

Write a function that takes an array of strings and returns a new array containing only the strings that are shorter than 4 characters.

Write a function that takes an array of numbers and returns a new array containing only the even numbers from the original array.

Write a function that takes an array of numbers and returns the sum of all the numbers in the array.

Write a function that takes an array of words and returns a new array containing only the words that are palindromes (words that are spelled the same forwards and backwards, like "racecar" or "level").

Try writing some code using loops, if statements etc to
- create a new array that is the reverse of the old array

- reverse an array by modifying it in place

- see what happens if you use the `delete` keyword on an array element

- see what happens if you index or `.find` an element that doesn't exist

- try out the built-in functions `map`, `filter`, `reduce`. See if you can get an intuition for what they do and how they're generally useful

My university programming course assignments.
Based on research, I think I should keep learning more of javascript for the time being.
 
@shivajikobardan, the exercises you list are a good start, other than they would be very simple for someone who has done any programming with functions that have array parameters. The freecodecamp exercises seem a little more involved, inasmuch as they are doing display kinds of operations.

Anyway, the more practice, the better you will get at coding. If you have problems with them, post the question and the work you have done in the Engineering & Comp. Sci Homework section, and I'm sure you'll get help.
 
  • Like
Likes   Reactions: shivajikobardan
thank you.
 

Similar threads

  • · Replies 18 ·
Replies
18
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 10 ·
Replies
10
Views
935
  • · Replies 4 ·
Replies
4
Views
2K
Replies
16
Views
6K
  • · Replies 1 ·
Replies
1
Views
4K