Coupling is defined as the degree of interdependence between two or more classes, modules, or components. Tight coupling is bad, and loose coupling is good.
Cohesion is defined as the degree to which all elements of a module, class, or component work together as a functional unit.High cohesion is good, and low cohesion is bad. The ideal situation is one where a module, class, or component provides only one function or, at most, a very closely related set of functions.
Abstraction means to hide internal implementation details.
The above structured program displays a menu for user's choice.there are 4 choices.
1=read album from file
2=print album from file
3=play album
4=update album
It first ask the choice and according to user's choice it will take a path from four given choices.Before doing the job it first check whether the album_opened it true of false.If true it will do the job otherwise it will display "No file is opened"
In above design checking for album_opened is a work which is done for each choice, which increase the time of processing so it will be better to make a separate module for if.So there is a little coupling.But cohesion is high as each module is performing a separate function and they all work together.The design has abstraction as we bother about what we want to do,and we have to do nothing with how the work is being done.
So the above design is a good structured programming(Abstraction+good coupling+good cohesion)
Demonstrate the related structured programming design principles in the diagram (music player programming). Eg: where i...
CSC 142
Music Player
You will complete this project by implementing one class.
Afterwards, your program will play music from a text file.
Objectives
Working with lists
Background
This project addresses playing music. A song consists of notes,
each of which has a length (duration) and pitch. The pitch of a
note is described with a letter ranging from A to G. 7
notes is not enough to play very interesting music, so there are
multiple octaves; after we reach...
Assignment Overview This programming assignment is intended to demonstrate your knowledge of the following: Writing a while loop Writing a for loop Writing a while loop with a sentinel value Chocolate Coupons Foothill Fro-cho, LLC, gives customers a coupon every time they purchase a chocolate bar. After they earn a certain number of coupons, they qualify for a free chocolate bar, which they may use toward the purchase of a single chocolate bar. Usually, 7 is the...
COP 2220 Into programming in C(Answer in C, not C++). The question is: Please write the algorithm for a AppStore programming assignment. The details of the assignment, a sample algorithm, and its outline, are located below. Make the algorithm at least half a page, easy to read, and to understand, how it works. I just want the algorithm, not the programming code, I have that. I only need the ALGORITHM. Thanks for helping me out, I apprieciate it, have a...
Please i need helpe with this JAVA code. Write a Java program simulates the dice game called GAMECrap. For this project, assume that the game is being played between two players, and that the rules are as follows: Problem Statement One of the players goes first. That player announces the size of the bet, and rolls the dice. If the player rolls a 7 or 11, it is called a natural. The player who rolled the dice wins. 2, 3...
This is java.
Goal is to create a pacman type game. I have most of the code
done just need to add in ghosts score dots etc.
Attached is the assignment, and after the assignment is my
current code.
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Arrays;
import java.util.Scanner;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
public class Maze extends JFrame implements KeyListener {
private static final String[] FILE = {...