Programming & Computer Science Answers

C++ 9913
Python 5288
Java | JSP | JSF 3611
C 1680
C# 1362
Computer Networks 989
Algorithms 652
Databases | SQL | Oracle | MS Access 641
HTML/JavaScript Web Application 588
Other 537
Visual Basic 358
Assembler 209
Software Engineering 202
AJAX | JavaScript | HTML | PHP 166
MatLAB 150
MatLAB | Mathematica | MathCAD | Maple 124
Action Script | Flash | Flex | ColdFusion 112
UNIX/Linux Programming 89
Web Development 73
Excel 36
ASP | ASP.NET 23
Delphi | Pascal 21
Perl 16
Prolog 9
Functional Programming 9
MathCAD 5
Wolfram Mathematica 4
WPF 4
Ruby | Ruby on Rails 3
NodeJS Web Application 2

Questions answered by Experts: 26 876

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

The table given below shows the list of gases, liquids and solids. By entering the substances, find the state of the material. Implement the above logic through C++. [Note: Use call by value]



S.No.


Materials


1


Water


2


Oxygen


3


Gold


4


Ice


5


Petrol




Write a program that print the second last digit of the given number. The second last digit is being referred to the digit in the tens place in the given number.

For example, if the given number is 197, the second last digit is 9.

Note 1 - The second last digit should be returned as a positive number. i.e. if the given number is -197, the second last digit is 9.

Note 2 - If the given number is a single-digit number, then the second last digit does not exist. In such cases, the program should print -1. i.e. if the given number is 5, the second last digit should be print as -1


String Slicing


Given two strings

inputString and subString as inputs, write a JS program to slice the inputString if it includes the subString. Slice the inputString starting from the subString to the end of the inputString.
Input

  • The first line of input contains a string inputString
  • The second line of input contains a string subString

Output

  • The output should be a sliced string or inputString (if the inputString does not include the subString)


Sample Input 1

JavaScript

S


Sample Output 1

Script


Sample Input 2

Language

air


Sample Output 2

Language




Trekking Kit


function Trekking(kit, item) {

 this.kit = kit;

 this.item = item;

}


function main() {

 const item = readLine();

 const trekkingKit = {

  ruckSackBag : true,

  clothes: ["Shirt", "T-Shirt/Full sleeves","Jeans"],

  firstAid: true,

  waterBottle: "2 liters",

  sunGlasses: "UV Protection",

  headTorch: true,

  medicines: true,

  footWear: "Non-skid",

  food: ["dry fruits", "nuts", "chocolate bars"]

 };

  

 /* Write your code here */

}


Sample Input 1

ruckSackBag

Sample Output 1

true

Sample Input 2

surfboard

Sample Output 2

false


i want code in between write code here


Create a struct Rectangle where a rectangle is defined by Length & Width. Each

Rectangle has an area and perimeter. You can also compare two rectangles with

respect to the area.


Unite Family

Given three objects

father, mother, and child, write a JS program to concatenate all the objects into the family object using the spread operator.Input

  • The first line of input contains an object father
  • The second line of input contains an object mother
  • The third line of input contains an object child

Output

  • The output should be a single line string with the appropriate statement as shown in sample outputs

Constraints

  • Keys of the objects should be given in quotes


SampleInput 1

{'surname' : 'Williams', 'city': 'Columbia'}

{'dish': 'cakes'}

{'pet': 'Rocky'}


Sample Output 1

Mr and Mrs Williams went to a picnic in Columbia with a boy and a pet Rocky. Mrs Williams made a special dish "cakes"


Sample Input 2

{'surname' : 'Jones', 'city': 'Los Angeles'}

{'dish': 'puddings'}

{'pet': 'Peter'}

Sample Output 2

Mr and Mrs Jones went to a picnic in Los Angeles with a boy and a pet Peter. Mrs Jones made a special dish "puddings"






Write a function that, when you call it, displays a message telling how many times it has been called: “I have been called 3 times”, for instance. Write a main()program that calls this function at least 10 times. Try implementing this function in two different ways. First, use a global variable to store the count. Second, use a local static variable. Which is more appropriate? Why can’t you use a local variable.


Array of Strings to UpperCase

Given an array

myArray of strings as an input, write a JS program to convert all the strings in myArray to uppercase.
Input

  • The input will be a single line containing an array myArray

Output

  • The output should be a single line containing an array of strings in uppercase


Sample Input 1

[ 'book', 'table', 'strawberries', 'lemons' ]


Sample Output 1

[ 'BOOK', 'TABLE', 'STRAWBERRIES', 'LEMONS' ]


Sample Input 2

[ 'my best friend', 'florida', 'winter' ]


Sample Output 2

[ 'MY BEST FRIEND', 'FLORIDA', 'WINTER' ]




Population

Write a program that will predict the size of a population of organisms. The program should ask the user for the starting number of organisms, their average daily population increase (as a percentage*), and the number of days they will multiply. A loop should display the size of the population for each day.



Write a program that will predict the size of a population of organisms. The program should ask the user for the starting number of organisms, their average daily population increase (as a percentage*), and the number of days they will multiply. A loop should display the size of the population for each day.

In addition to passing the Mimir test cases know that I will view your code to ensure you have the correct functions and that your code writes to a file.

Your code should include the following functions

  •  function to get value for the starting number organisms
  •  function to get a valid value for the average daily
  •  function to get a valid value for the number of days



 



Write a class C2 that inherits all the functionality of A2 and B2,

// with the same stipulation that it should take f() from A2 and g() from B2.


LATEST TUTORIALS
APPROVED BY CLIENTS