Can you share exercises/assignments of programming?

  • Thread starter shivajikobardan
  • Start date
  • Tags
    Programming
In summary, the Ringbuffer object can store a buffer of characters, numbers, or words, and it has a method for copying data from one location to another. It can also be used to reverse an array, and the built-in functions `map`, `filter`, `reduce` are useful for manipulating data.
  • #1
shivajikobardan
674
54
TL;DR Summary
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
  • #2
Here is a design document I wrote for a teenager some years ago:
Design Document For RingBuffer
Basic object:
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);
  }
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 shivajikobardan
  • #3
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.
 
  • #4
@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 shivajikobardan
  • #5
thank you.
 

FAQ: Can you share exercises/assignments of programming?

What kind of programming exercises/assignments can you share?

I can share a variety of programming exercises and assignments, including beginner level exercises for learning basic concepts, intermediate level exercises for practicing skills and problem-solving, and advanced level assignments for challenging projects.

Can you share exercises/assignments for specific programming languages?

Yes, I can provide exercises and assignments for a variety of programming languages, including but not limited to, Java, Python, C++, JavaScript, and HTML/CSS.

Are these exercises/assignments suitable for self-study or do they require a mentor?

These exercises and assignments can be suitable for both self-study and mentor-led learning. However, having a mentor or tutor can be beneficial in providing feedback and guidance on your progress.

Can these exercises/assignments help me prepare for coding interviews?

Yes, these exercises and assignments are designed to help you improve your programming skills and prepare for coding interviews. They cover a variety of topics and concepts that are commonly tested in coding interviews.

Are these exercises/assignments suitable for all skill levels?

These exercises and assignments can be suitable for all skill levels, from beginners to advanced programmers. However, some exercises may be more challenging for beginners and may require additional resources or guidance.

Back
Top