/** * Car Define a class named Car, which should have the name and model as the properties. You don't need to worry about input/output and object of the class. The given template will take care of it. The input will contain the name and model. Their default values should be Audi and A4 respectively. Input First line contains an integer, either 1 or -1. If the first line is 1, then: One line containing two space separated values, denoting name and model respectively. Output Print name and model in newline each. Example Input1: 1 Ford C4 Output1: Ford C4 Input2: -1 Output2: Audi A4 Explanation Example 1 First line is 1, which denotes space separated values as input to the class. Ford C4 denotes the values for name and model respectively and we print name and model in new line each. Example 2 First line is -1, which denotes we need to print the default values line by line. */ let fs = require ( "fs" ); let data = fs . readFileSync ( 0 , 'utf-8' ); let idx...
/** * Print Movie Description -- Classes Practice Problems Write a Movie class for which you can create movie objects. The objects should have the following variables: integer length_in_minutes, integer num_characters, string language. Each object should also have a run method which prints out: "This is a movie with characters and is minutes long." Input First line is a string, denoting the language of the movie Second line is an integer, denoting the number of characters Third line is an integer, denoting the length in minutes Output The output should be the return statement of run: "This is a movie with characters and is minutes long." Example Input: French 4 200 Output: This is a French movie with 4 characters and is 200 minutes long. First line is French indicating the movie's language is French Second line is 4, indicating that the movie has 4 characters Third line is 200, indicating that the movie is 200 minutes long */ let fs = require ( ...
Comments
Post a Comment