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

Write a Python program that will ask the user to enter a word as an input.

  • If the length of the input string is less than 4, then your program should print the same string as an output.
  • If the input string’s length is greater than 3, then your program should add "er" at the end of the input string.
  • If the input string already ends with "er", then add "est" instead, regardless of the length of the input string
  • If the input string already ends with "est", then your program should print the same input string as an output.

Command line argument count program in java

Machine problem 2


Create a Python script that will generate random n integers from a given start and end of a range.


Sample Output:


Value for n:5


Value for start: 1


Value for end : 10


10 8 7 8 3

Given a sorted array of data with lower bound LB and upper bound UB, and items is a given item of information. Using variables BEG,END and MID to denote, respectively,the beginning end and middle locations of a segment of elements of Data. Write a c++ program which finds the location LOC if item in DATA or sets LOC=NULL

Create two numpy arrays and add the elements of both the arrays and store the result in sumArray.


Samuel owns a shoe factory where there are N different machines operated for N different purposes. Each machine has its own motor. In order to avoid resonance, the rotation speed of any 2 machines should at least differ by 2 units. The rotation speed can only be in integer units and the maximum rotation speed of any motor is X units. Given minimum rotation speed of any motor to be 1 unit, you have to help Sam find out the number of different ways he can configure the speed of the motor. Input Specification: input1: N, denoting the number of machines. input 2X, denoting the maximum speed of the motor. Output Specification: Your function should return the total number of configuration modulus 10^4.

Find the Duplicate in the array

Given an myArray write a JS program to find duplicate in the Array.


input1

[1,2,3,4,5,7,7,8]

output1

7

output1

{'light'', "dark", "twinlight"]


"use strict";


process.stdin.resume();

process.stdin.setEncoding("utf-8");


let inputString = "";

let currentLine = 0;


process.stdin.on("data", (inputStdin) => {

inputString += inputStdin;

});


process.stdin.on("end", (_) => {

inputString = inputString

.trim()

.split("\n")

.map((str) => str.trim());


main();

});


function readLine() {

return inputString[currentLine++];

}


function main() {

let myArray = JSON.parse(readLine().replace(/'/g, '"'));


/* Please do not modify anything above this line */


/* Write your code here */

}


Part 1

Write a Python program that does the following. 

  • Create a string that is a long series of words separated by spaces. The string is your own creative choice. It can be names, favorite foods, animals, anything. Just make it up yourself. Do not copy the string from another source. 
  • Turn the string into a list of words using split
  • Delete three words from the list, but delete each one using a different kind of Python operation. 
  • Sort the list. 
  • Add new words to the list (three or more) using three different kinds of Python operation. 
  • Turn the list of words back into a single string using join
  • Print the string. 

Part 2

Provide your own examples of the following using Python lists. Create your own examples. Do not copy them from another source. 

  • Nested lists 
  • The “*” operator 
  • List slices 
  • The “+=” operator 
  • A list filter 
  • A list operation that is legal but does the "wrong" thing, not what the programmer expects 

Provide the Python code and output for your program and all your examples.


Add methods to the classes and subclasses:


  • a Movie can calculate:
  • totalMinutes()
  • for example, a movie 1 hour and 40 minutes long = 100 minutes total
  • a Snack can calculate:
  • amtHarm()
  • = the #calories times the amount of sodium or sugar
  • an Employee can calculate:
  • employeeMonthlyPay()
  • assume Staff work 40hours/week and 4 weeks/month

In the main code:


  • make lists for movies, snacks, and employees
  • use loops to find:
  • the total length of all movies
  • the most dangerous snack
  • the poorest employee

Mr Kishan owns a supermarket and he has stored the price of all items in an array. However he wants to now increase the price of all items by Rs 5. Write a program using functions which increments the price of all items by Rs 5 and displays the updated list.


LATEST TUTORIALS
APPROVED BY CLIENTS