instruction
stringlengths
71
71.9k
This is my second attempt at K&R 1-23, Write a program to remove all comments from a C program. Don't forget to handle quoted strings and character constants properly. C comments don't nest. I was previously packing characters into various io buffers, and someone suggested this was not a good choice. Thought I'd ...
Question: Given a sequence of positive integers A and an integer T, return whether there is a continuous sequence of A that sums up to exactly T Example: A = [23, 5, 4, 7, 2, 11], T = 20: True because 7 + 2 + 11 = 20 A = [1, 3, 5, 23, 2], T = 8: True because 3 + 5 = 8 A = [1, 3, 5, 23, 2], T = 7: False because no seque...
I am developing a class (in a C# MVC 5 project) that originally had a using block within a single method, and it got to be very huge after placing formatting statements and other code in the using block. I am using the Nuget Epplus package to export a model's contents to an Excel document, and all of the tutorials I ca...
I have made a backtracking Sudoku solver in Python but it's working quite slow. Originally, It had been working on 4 by 4 grids, which worked fine. But now, trying to solve 9 by 9 grids takes a very long time. I haven't found out the exact reason but I feel that there is one major flaw that is making it so time consumi...
I implemented observer pattern and it will be great if someone can do review of my work and say what should be done better. What is the problem. Application monitoring rss channel, if there is something new then should do 3 things: send email to registered user that following stock which has news (only EBI and ESPI ch...
I have modularized my code and currently my "main" function is movieSalesReport(). I am coming from Python where you can have the functions return multiple values. In C++ it is not so simple and I learned through this question that I had to use something called referencing in C++ in order to mimic returning multiple va...
I wrote an application a while back to plan and manage drones races. (Well, it could be anything with identification numbers going through checkpoints.) At that time, communication between the gates (checkpoints) and the device running this application was done through XBee radios. When a gate detected a drone, it sent...
Recently I started to use mvvm light messenger and it lead to creating this ugliness which I have to refactor now. What would be the best future proof way to refactor this whole class? public partial class RootView : Window { public RootView() { try { InitializeComponent(); ...
It is a single-player game. In the beginning, there is a row of integers. In one move the player can take a certain amount of adjacent numbers (let's denote it T). Then the player's points increase with the sum of the chosen numbers. The player can take S moves at most. The goal is to determine the maximum points that ...
Company name asks you to build a website with 7 boxes shaped like a c, which should turn green on click, and then when all are clicked, should turn red in reverse clicking order. https://jsfiddle.net/yx296/dvacLduw/ document.addEventListener('DOMContentLoaded', function() { var boxHolder = document.querySelector("....
I have these types: data PizzaType = Cheese | Pepperoni | Anchovy data PizzaOrder = PizzaOrder { p_type :: PizzaType , p_specialInstructions :: Text } I want to use Aeson to create PizzaOrder instances from this JSON structure: { "type": "pepperoni", "specialInstructions": "please cut into nine sl...
Background Some time ago I've encountered some very good articles about neural networks that represented an ANN as a set of matrices, so everything was done using matrix operations. These articles show code written in Python, and since I know Python well, I decided to translate it to C++ (which I'm currently learning)....
I wrote a tiny shell script that basically installs a script into your system by copying it to someplace like /usr/local/bin, chmodding it, and adding it to your PATH. It works on both Unix and Windows (via an emulation layer like MSys or Cygwin). Its source code is available on GitHub. Here is the script in its entire...
I'm trying to shorten this piece of my code into a loop: <?php header('Access-Control-Allow-Origin: http://mysite.com'); ?> <?php if(sizeof($_POST)) { file_put_contents; } else { echo "ERROR! Must be activated from Tampermonkey script!"; exit(); } file_put_contents( "content.html", "<st...
Original question: Function to split either a string array or string into a string array I was asked why I didn't write multiple functions or something like that. The point of the function is to be a single one and to be able to receive an indefinite number of strings or string arrays and get the job done. Restrictions...
This is the second thing I've ever written in Python. I am just looking for what I could improve upon along with things that could be done better. It is as compact as I could make it with my current experience. import random def war_handler(): war_handler.count += 1 print "War is {0} is happening.".format(war...
I want to order columns of a dataframe using a substring of the column name only. Suppose my columns are named df <- data.frame("x_b"=5, "y_b"=2, "x_a"=6, "y_a"=3, "y_c"=1, "x_c"=4) and I want to order them using a first-order and a s...
Remove duplicate elements from linked list. #include<iostream> using namespace std; class LinkedList{ private: int data; LinkedList *next; public: void insert(LinkedList **start, int data){ LinkedList *p = new LinkedList; if (*start == NULL){ p->data = data; p->next ...
My question is similar to before, but now the code has changed completely. I would like to understand if this code is vulnerable to mysql injection. <?php // Define our querystring variables $option = (array_key_exists('option', $_POST) ? $_POST['option'] : false); $view = (array_key_exists('view', $_POST) ? $_...
I think this isn't right way. Maybe you can suggest something about error-displaying in error-container which fill in JS. index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Registration</title> <link rel="stylesheet" href="css/style.css"> </head> <body> <div class="display"> ...
This is my submission for the Prime Generator on SPOJ and it was accepted. Are there any improvements/changes I can make? Input: The input begins with the number \$t\$ of test cases in a single line (\$t \le 10\$). In each of the next t lines there are two numbers \$m\$ and \$n\$ (\$1 \le m \le n \le 1000000000\$,...
I created a short python program that can create a list of random unique nodes with a given length and a given number of strategies. The GA runs through a given number of generations, changing a random selection of strategies by using ordered crossover and an inverse mutation between two random indices. Each strategy h...
I am writing a program that allows a user to interact with MIDI-connected devices. Upon connecting a MIDI device, interactions with this device will update a GUI. Updates to the GUI include what keys are being pressed, if the volume is turned up/down, etc. In addition, the user can "request" the status of MIDI componen...
In continuation with this question, Animal class has four fields: name sound owner favFood Cat derived class has one field mode Derived class Cat is created such that every instance of Cat inherits instance members of Animal. In addition, Cat adds a new instance member mode. Constructor pattern is used amidst con...
I have always wanted to write a fluid simulation, and with the help of a paper and some StackOverflow users I've got something that works. My goal is to have a program that someone can run right away without having to install anything. My plans: Fix framerate (eventually) More configurable user input Have almost all ...
I am a new programmer and I want to know if I'm inheriting the right styles. I don't want to pick up any bad/amateur habits. Any advice would be much appreciated. This is an isUnique function I wrote in C. #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int x; char s1[] = "dog hi cob...
I am using spring-boot, spring data, and Java 6. Here is an example from a business layer to save student details. Srvice interface: public interface StudentService { public StudentDTO save(Integer stdId, Integer divisionId, StudentDTO studentDTO); } Service implementation: @Service("studentService") public class ...
I have the following Ruby code, which parses an XML document sax style (it's a very simplified version): require 'nokogiri' class ParsingError < RuntimeError; end class Parser def initialize mapper, collector, error_collector @error_collector = error_collector @sax_handler = Handler.new(collector, @error_co...
I wrote this simple page to help at work, and as an exercise to get more familiar with JavaScript. I'm especially interested in help with style and structure - is this "standard"? I know the input isn't validated at all - feel free to make suggestions here but this isn't my main concern at this time. behavior.js: var...
I am writing a function for my node/angular app that will prompt the user with a random question that he was not asked before. To achieve this I wrote this function: function setQuestion() { var q; // question we will eventually ask the user for (q in questions) { if (!(q._id in ...
I have 2 Flask apps (different projects) that work together . One implements some API which uses tokens for auth. The second one consumes the API and makes a web interface for it. Now I have a login function that sends the username and password to the API, and if correct, gets the auth token in return. Once I have the ...
I have written some code to practise graphs. Graph is represented as vector<list<int>> . Would you share some feedback with me? Are algorithms correct and perform well? I implemented graph using vector<list<>> because of the name "adjacency lists". However now I think using unordered_map would be cleaner and would per...
This snippet is about sorting a set of strings using merge sort. However, this version is tailored for strings as it relies on lcp values: Given two strings \$A\$ and \$B\$, \$lcp(A, B)\$ is the length of the longest prefix shared by both \$A\$ and \$B\$. The cool point to note here is that if you know at least a lower...
I have been working on a long project trying to understand the basics of multi-threading. The application is supposed to simulate a Shop and a Customer which share a Box and a PayPal account. Main.Java package exe5; public class Main { static Thread mainThread = Thread.currentThread(); public sta...
I'm looking for a fast OR simple way to calculate the volume of a user-entered cylinder. Here is my solution: #include <iostream> using namespace std; #include <math.h> int main() { long double pi = acos(-1); cout.precision(1000); long double radius; long double volume; long double height; cou...
I have walls that I can spawn. They wll move in one of four directions, up, down, right or left. Now I can set, wether the wall is thin, wide, long or short, but the problem is: Nearly everything I do with the walls depends on wether they move up, down, left or right and because of this I use my direction enum extremel...
Give all the partitionings of a string s such that every substring of the partition is a palindrome What is the time complexity of this solution? And, how can I improve my code overall? List<List<String>> resultLst; ArrayList<String> currLst; public List<List<String>> partition(String s) { resultLst = new Arra...
I am trying to make an OOP abstraction for a very simple HTTP client. I have also created a simple abstraction for a (GET only for now) HTTP request. I am using winsock2 sockets for Windows and examples from the internet. This is the request class: httpRequest.h #ifndef httpRequest_H #define httpRequest_H #include <s...
I wrote an isPermute method. Can I get some tips and advice on better coding style? #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> bool isPermute(char*, char*); char* sort(char*); int main(int argv, char **argc) { printf("%s and %s are %spermutations of each other. \n", argc[1], arg...
I have written a working Brainfuck interpreter using ClojureScript, reagent, core.async and dommy. I am not very satisfied with the code, however, in particular the central part of the code - the interpreting function, step. It is a pages-long mess of nested conditionals. I would like to simplify it somehow. One thing...
Let's say you want to extract the output of a console application till you've found a certain keyword. If you have found the keyword the started console process still should be running, however the function which has found the keyword should return. Here is a minimal application which simply creates an output of n line...
This is for commercial purposes. It's not going to a database, but will just be emailed to a person via phpMailer. I am not good at PHP (truly awful). I'd like to know whether this is good enough for going production or not. <?php session_start(); //allows use of session variables if ($_SERVER["REQUEST_METHOD"] == "PO...
I needed a quick caching mechanism to save a bitmap (picture). There was no way I could get the bitmap to the class where I need to upload it to the server so for the sake of organization and code cleanliness I created this. I have never seen this before implemented this way but to me this not only fits the purpose but...
I am currently working on a GPA Calculator side project over holiday break to become more familiar with Swing, but I find the number formatting is more complicated than in regular Java. At the moment I have a working prototype, but the number formatting on the overall GPA is way to long. I have tried to achieve this in...
I have created a solution for the problem as below: Given a string S consisting of letters 'O' and 'Z'. Calculate the minimum number of changes required such that all O's are adjacent to each other and all Z's are adjacent to each other. One change is equivalent to swapping two neighbouring letters for e.g for a...
Can I please have some advice on optimizing, cleaning up my code, and places where I could save space/time? #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> bool pal_perm(char*); int main() { printf("The output is %sa palindrome.\n", pal_perm("abbas")? "": "not "); //Output: The outp...
The Go programming language has that slice type, which is under the hood a pointer to an actual array. This allows treating the subarrays as actual arrays with almost no performance overhead. This code snippet is about implementing slice type for C++ arrays and vectors. slice.h: #ifndef SLICE_H #define SLICE_H #includ...
I wrote a script to convert CSV files in human readable format and vice versa. Human readable format is achieved like so: $ ./transform table.csv inflate cola colb colc 1 a g 2 b g 3 c g 4 d g 5 eeeeeeeee g And conversion back to CSV is done with: $ ./transformtable ...
I am creating a connect 4 game in python and I have managed to write the code so that it runs. However I have a lot of duplicated data in it and was just wondering if anyone could help me to refine it to minimise this? Here is my code so far: def CreateBoard(r, c, b, n): for i in range(1,(r+1)): n.append(str(i))...
I'm trying to get back into programming by building an app I've had in mind for quite a while. I've created an SQLite database and have managed to get some data in it. I'm trying to display the data inside a Listview, and whilst it is displaying, I'm concerned I've made things more difficult for myself for making the L...
I've started out working on a larger project using Angular for the first time. For visual feedback, I'm using Waves (Github) (you can see a demo page here). The standard way to use Waves is to include the script along with its CSS on the page and once the page has finished loading, call Waves.init(); to bind to all el...
Write a procedure substitute that takes three arguments: a list, an old word, and a new word. It should return a copy of the list, but with every occurrence of the old word replaced by the new word, even in sublists. For example: > (substitute ’((lead guitar) (bass guitar) (rhythm guitar) drums) ’guitar ’axe) ((lead...
I would like to reverse a list using cdr, car and cons. Since lists in lisp are asymmetrical (can only insert at the beginning), I am interested on how one would write a procedure to do that without using (append). Please review my code. (define (reverse l) (define (aux orig result) (if (null? orig) result ...
I am trying to learn JS and I am trying to make a simple calculator which will calculate price against number of people and will give discount on some amount of people. For instance, every 6th person is completely free. Here is example what I did until now. HTML <input type="number" id="int_no_of_people" value="" o...
Here is code I wrote to concatenate data files into master file. Once the data to be pasted into the master sheet exceeds the number of rows left in the master sheet, the program will create a new master document and continue the process. Help me clean it up and make it faster if you can. Option Explicit Public NewMast...
I am trying to write a code that: First Prompt: asks the user to select the folder that contains all zipped folders where each zipped folder contains a data file. Second Prompt: Ask the user to select the master folder path to place the unzipped data files into. The program will unzip the first zipped folder, copy th...
I am currently working on a side-project and have the basic foundation and architecture I want in place for the site. I wanted to get your opinion and thoughts on my current practices and methods before I get too deep down the rabbit hole and any potential issues would be difficult to remove. The basic premise of the s...
I am trying to implement an HashMap in C. I am trying to used a linked list style of interfacing to make adding and removing keys easy and efficient. Searching is not something I am considering at this point as it is early in progress. I am looking for any tweaks that could make this faster, more memory efficient, more...
I have a MongoDB collection setup where each document's JSON looks like this: { "_id" : "Stuff", "project_id" : "1234", "VehicleEntry" : [ { // Irrelevant fields removed. "VehicleStatus" : "PASSED" }, { // Irrelevant fields removed. "Ve...
This question is an improvement I did based on recommendations from these other questions: Simple object-oriented calculator Simple object-oriented calculator - follow-up To those looking this question first I'm trying to find a correct OOP model I can use in JS. I initially found a very different solution from what's...
I liked this problem because there are so many sub-problems that are interview problems in their own right-- (reverse linked list, find midpoint) var Node = function(val) { this.val = val; this.next = null; } var a = new Node('r'); var b = a.next = new Node('a'); var c = b.next = new Node('c'); var d = c.next = ne...
Problems was to calculate maximum product of word lengths: Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. You may assume that each word will contain only lower case letters. If no such two words exist, return 0. Given ["abcw"...
To try and track down a troublesome AS400 bug, my company wants me to keep track of the order in which files are put into a folder. I spent an hour whipping something up in Go, but I'm still pretty new to Go so I'd like an opinion on a couple points: Idiomatic Go: how do I make it more "Go"-like? My method of freezing...
I recently got to a certain exercise in a book I am reading, and am looking for feedback. It is a program in which the user picks a number and the computer uses algorithms to guess it. If there is any way that I can improve my code, feedback is really appreciated! #include <iostream> #include <string> #include <cstdlib...
I likes my use of functions so I'm mostly looking for little things but if you see something tell me :) #include <iostream> using namespace std; void addQuarter(double &num); void addDime(double &num); void addNikle(double &num); void addPennie(double &num); bool quarterValid(double num, const double finalNum); bo...
I have written a client for streaming video playback. The client uses two threads, a receive thread and a decode thread. Events are fired off periodically for drawing a completed frame onto a SDL window. SDL mutexes is used for creating and locking shared resources. Currently, I am trying to split things up so I create...
I have made a procedure to display the highest and the lowest popular Items for a particular time of a given date. The procedure works with no errors or exceptions and everything is functional. As you can see, the queries are repeated twice for the purpose of showing the first record on Items, but the only differences ...
I have an implementation of the reduction approach used in this document. Furthermore, I extended (crudely) this so I can reduce-by-key. In my setup I can assume that a key array variable is constant through subsequent calls to a reduction kernel and that it is sorted in increasing order, and can thus pre-process and m...
I tried implementing TLV(https://en.wikipedia.org/wiki/Type-length-value). Actually my implementation is more than TLV because it supports additional "Tag" elements (which you can use for naming certain TLV objects) for TLV objects. My goal is to serialize the array of TLV objects to byte array and vice versa (this I d...
Given is an array which contains sub-arrays. The elements in this sub-arrays are numbers. The task is to implement a JavaScript-function which returns an array with the smallest / largest numbers in the single arrays. I have figured out this solution: // Returns the smallest / largest // numbers contained in a // ...
My program takes static input, and then number crunches for a few hours. I am currently using Macros, but is there a better, more "user friendly" way to do this without losing on performance. I have written a program in C to generate Seed programs from a Befunge program. It is a very long, brute force calculation. So t...
I have created a site for practice and I have already asked a question on Stack Overflow about XSS. Someone tell me to show your php functions on this site that i created using filter_Var These are two PHP functions I created that sanitize/validate user input and after passing the the user input in these function I ...
I have created a reusable code for jQuery tab functionality for my client site. Every thing works fine but the only thing I am worried is that the lines code I have written for this small feature is very high. Can any one help me to shrink lines of code or any suggestions. Here is my JavaScript code: /** * @param lin...
I'm just learning JavaScript and jQuery, and I've got some code that works, but I know it can be optimized. I have a page that when a button is clicked it adds 1 to a label, and then increments a bootstrap progress bar by 1. I have 6 functions that could probably be reduced to 2 by passing in arguments instead of havi...
The following class monitors the clipboard and raises an event whenever the contents change. The monitoring starts when the class is created and ends when Dispose is called. To achieve this a message-only window (a term that comes from the Win32 API) is created using an instance of HwndSource class (since I am using WP...
I have two very similar SQL statements INSERT INTO user_profile (user_id, setting_id, value) SELECT id, 18, true FROM users WHERE NOT EXISTS ( SELECT user_id, setting_id FROM user_profile WHERE id=user_id AND setting_id=18); INSERT INTO user_profile (user_id, setting_id, value) ...
In a JSP page I have a number of Span elements. Each of this span element will be floating point numbers. All these span elements has class "format-decimal-precision": <span class="format-decimal-precision">${info.flaot_val}</span> I would like to display all this floating point numbers with 3 decimal point precision....
After following the tips from @VoiceOfUnreason on my previous question, I want to post the revised code. The purpose of the code is to simulate a Shop and a Customer that use the Box service of the Shop while have a Paypal account that he must deposit money into before being able to use that Box service. Main.Java pack...
I'm new to Flask and Python and am trying to sort out the most pythonic way to modularize my utilities. I have models.py which have my sqlalchemy models and views.py which handles the routes, etc... My util.py basically handles the queries and data manipulation between the two but I want to know if I'm doing it right....
Overview I have 165,000 *.rds files that are around 200,000 obs x 13 variables each. These files are unique to grid files (2.5 square mile data) so I need to keep them in their unique grid numbers. Currently, I'm loading each individual file, performing some function on the data, and resaving them to another director...
I am a beginner at web development and I write code as a hobby. Would you please critique this code? I created a Tic-Tac-Toe game using HTML/CSS and jQuery. I did it for fun as a personal challenge. An image of a game board shows up initially. Each empty square can be clicked. Depending on if the turn is "even" o...
While looking at PHP.net this afternoon, I saw a comment in round() for two functions for rounding UP and DOWN (as opposed to just HALF_UP and DOWN). I liked the suggestion, but wanted a solution that was one function instead of 3, so I came up with the following: define('PHP_ROUND_UP', 11); define('PHP_ROUND_DOWN',...
I've created a program that will take, a bunch of numbers from a range of 1 - 255, and then put them into 3 different strings(servers) equally. It does this by having a count that starts at 1 and loops to 3, once the count has hit 3 it restarts until three servers have hit a max capacity of 100 numbers within it. Once ...
Exercise 2.20.   The procedures +, *, and list take arbitrary numbers of arguments. One way to define such procedures is to use define with dotted-tail notation. In a procedure definition, a parameter list that has a dot before the last parameter name indicates that, when the procedure is called, the initial parameter...
After finding a piece of code on StackOverflow that drew the Koch snowflake fractal, I made a ton of modifications to it and used it to produce an animation divided in two parts: Constant size, recursion depth increasing. Constant recursion depth, size increasing. You can see the animation here. I am interested mainl...
I am an Angular.JS beginner and this is my first application. I hope you give me some advices what to do to have better, optimized code. This application manages the data from database, shows it in table, allows to add new rows, edit existing records and delete them. Here is a content of my controller. I have only one...
The original question can be found here. While looking at PHP.net this afternoon, I saw a comment in the documentation for the built-in function round(). The comment offered two functions for rounding UP and DOWN (as opposed to just HALF_UP and DOWN). I liked the suggestion, but wanted a solution that was one functio...
In SE chat, there are two different ways to mention people: A "ping" to just get a user's attention, and a "reply" that points out a specific message by the user. This script makes it so that beginning a message with (by default) @username@, the message is made a reply to username's most recent message. Additionally, a...
One of the reports I am working on requires me to locate searches a customer makes, and graph them in certain manners. I have one query I'm particularly concerned about. This one takes the most amount of time (relative to the batch) and seems quite ugly to me. Essentially, this should graph the search results by the da...
I created this JavaScript class using ES6-ES7 syntax to return an array of page numbers and ellipsis points (null) to be consumed by a function which will create a styled paginator. What I am looking for in a code review is how the code could be improved for optimal readability, improved for speed, and simplified if po...
I wanted to try multithreading out in C, so I did Dining Philosophers using C11 threads with the approach of having one of the philosophers left-handed. Any suggestions? #include <stdio.h> #include <threads.h> #include <stdlib.h> #define NUM_THREADS 5 struct timespec time1; mtx_t forks[NUM_THREADS]; typedef struct {...
My latest inspection for Rubberduck determines whether a procedure should be a function by checking whether it has a single ByRef parameter (either explicit or implicit). The quick fix takes this procedure, changes it into a function, and updates all calls. This inspection starts deep down, involving the parser: priva...
I am trying to use a custom sql query to display different attributes for a product i.e. Size and Price. The query I have when running in console displays as it should SELECT products.id, products.name, variant_properties.description, LEFT(variant_properties.description,1) as short_desc, variants.price FROM products ...
Project Euler #4 A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Find the largest palindrome made from the product of two 3-digit numbers. Any reviews are accepted. #include <iostream> #include <algorithm> #include <string> bool...
At first I calculate the total of each data then give each data of data a percentage base on total. The percentage is calculated by adding its percentage and sum of all percentage before it. I then calculate a new value by multiplying percentage and total. I finally sort them from largest to smallest. How can I reduce ...
I gave problem #22 on Project Euler a try in Python3. Other than suggested in the instructions, I used requests to fetch the file to work on. The code below does produce the correct result but takes no measures to catch exceptions if something breaks, e.g. when the download is not successful. I managed to split a strin...
I've seen the code for this function in John Resig's book 'Secrets of JavaScript Ninja' yesterday. I considered it useful at once because I've disliked repeatedly typing console.log for some time. Here's my implementation of a helper function to reduce typing: // -- Function definition ------------- // Helper function...
I tried to create a very simple Webview with embedded video's in it, that can change to vertical and not reset to its default when changed to vertical or vice versa, even tho its working just fine I'm still feeling like the site is a bit heavy (its a simple wordpress website with some textual data and images, nothing h...
I'm coding a very simple reverse shell in python, and I want to encrypt the communication between the server and the client. The idea is to exchange an AES key using RSA then use it to encrypt everything sent on the network. Right now I'm trying to use PyCrypto's Crypto.Cipher.PKCS1_v1_5 module for RSA and it seems to ...
My Application looks something like this (Screenshot). To Control the URL Routing i am using a Angular Js Router. On Click of Store of the Side Panel the StoreList Appears. And on Click of the Edit, the portion template gets fetched from Spring MVC and displayed along with the details. I have written the Code for app.j...