2 Replies - 1208 Views - Last Post: 03 May 2017 - 07:58 AM Rate Topic: -----

#1 gtorresgz  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 28-April 17

Ruby MVC Pattern

Posted 28 April 2017 - 01:55 PM

I solve this problem with OOP without MVC Pattern, can anybody explain me?

A marketing department requires a small object-oriented program to obtain the maximum discounts that can be made to the prices of the packages of promotions that will launch for Independence day.
For each package you register your promotion code, sector (A, B, C or D), average age of the buyers and price of the package.
Possible to make discount will be:
Discount package price = (Factor x + Factor and) / 100
Where:

Sector Factor x
To 10
b 20
C 24
D 30

Average age Factor and
< 18 or > 60 10
> = 18 and < 25 15
> = 25 and < 60 20

Print all packets of promotions with their respective maximum discounts.
Apply polymorphism, Factory pattern and MVC pattern in the solution of the problem.

Is This A Good Question/Topic? 0
  • +

Replies To: Ruby MVC Pattern

#2 xclite  Icon User is offline

  • I wrote you an code
  • member icon


Reputation: 1237
  • View blog
  • Posts: 4,028
  • Joined: 12-May 09

Re: Ruby MVC Pattern

Posted 29 April 2017 - 05:07 AM

What are your thoughts? What have you tried?
Was This Post Helpful? 0
  • +
  • -

#3 NeoTifa  Icon User is offline

  • NeoTifa Codebreaker, the Scourge of Devtester
  • member icon





Reputation: 4081
  • View blog
  • Posts: 18,152
  • Joined: 24-September 08

Re: Ruby MVC Pattern

Posted 03 May 2017 - 07:58 AM

MVC pattern is just a way of structuring your code. Here is a Rails diagram. Is your app Rails? It doesn't have to be to be MVC though.

Posted Image
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1