Ask the user to enter - Name - ID - File Name Randomly choose five grades for that person from 1 to 100 and store them in an array that can hold five integers. Then output the name, ID, and those five grades to the screen and save the output into the specified file. The file will look like: --------------------------------- 220181234 Ahmed Ihab Grade 1 : 60 Grade 2 : 75 Grade 3 : 30 Grade 4 : 96 Grade 5 : 63 ---------------------------------- Note: Write the File using Buffered Writer

Member Avatar
Member Avatar
+0 forum 2

Given two arrays (the first array and the second array) of the same size, each consisting of n positive integers, write a program to determine how many unique integers the second array has. Here a unique integer means that it shows only once in the second array but does not show in the first array. For example, if the first array is [1, 5, 3, 6, 8] and the second array is [2, 4, 2, 5, 9] (with n=5), the second array has two unique integers (4 and 9). What is the complexity of the program?

Member Avatar
Member Avatar
+1 forum 1

Ask the user to enter - Name - ID - File Name Randomly choose five grades for that person from 1 to 100 and store them in an array that can hold five integers. Then output the name, ID, and those five grades to the screen and save the output into the specified file. The file will look like: --------------------------------- 220181234 Ahmed Ihab Grade 1 : 60 Grade 2 : 75 Grade 3 : 30 Grade 4 : 96 Grade 5 : 63 ---------------------------------- Note: Write the File using BufferedWriter

Member Avatar
Member Avatar
+0 forum 1

Task 2: Write a program that simulates an unbiased coin flip. Your program should print true if the coin flip results in a head and false if the coin flip results in a tail. Hint: any value greater than 0.5, represents Head otherwise it represents Tail

Member Avatar
Member Avatar
+0 forum 1

Hi, I was learning 'Selection Sorting' in C and while writing my program I constantly get the error- >[Error] expected expression before '{' token Here's my program- #include<stdio.h> void main(int A[10]) { int i,j; A[10]={2,4,1,9,0,6,5,7,3,8}; for(i=0;i<9;++i) { int Min=i; for(j=i+1;j<10;++j) { if(A[j]<Min) { Min=j; } int temp=A[i]; A[i]=A[Min]; A[Min]=temp; } } for(i=0;i<10;++i) { printf("%d\n",A[i]); } } If I try to initialize A[10] as a parameter in the function, it gives this error- >[Error] expected ';', ',' or ')' before '=' token What's the issue?

Member Avatar
Member Avatar
+0 forum 4

write a C program to sort a csv(student.csv)file using QSORT on LINUX .. please help.. student.csv file containing(student name, percentage)

Member Avatar
Member Avatar
+0 forum 1

![71923951_2309021662681505_5309298929043505152_n.jpg](/attachments/large/4/1849a45b2f18751c208bb45861be2f10.jpg)

Member Avatar
Member Avatar
+1 forum 3

Hi there everybody just needed some help sorting an object array. So the array takes in a title, link, comment, length, and rating of the video. Once the values are put into the array the user inputs whether they want to sort it by title(alphabetically), length of the video (ascending order), and then rating of the video (descending order). The code runs and compiles perfectly fine right now but just dont know how to put in the place the sort functions. ** VIDEO.H** #ifndef VIDEO_H #define VIDEO_H class Video{ public: Video(string t, string l, string c, float time, int a); …

Member Avatar
+0 forum 0

Firstly a little overview - my site uses Wordfence (this is not the issue - just the reason for this to begin with) -- Even if Wordfence is disabled this should still work. *its just what brought this to light.* And... I have been getting numerous login attempts from different places and IP's using the hidden password recovery, or simply force loading names into the admin page. I have seen a pattern emerging, whereas the popular name tries are: administrator, wpadmin, admin, wpadministrator, and a few others. Sometimes in the range of 150+ an hour, quite amazing, and annoying at …

Member Avatar
Member Avatar
+1 forum 6

Hey I'm trying to make a sudoku solver. Im stuck at printing the sudoku elements using outtextxy. My command line is : for(i=0;i<w;i++) { for(j=0;j<w;j++) { if(A[i][j]==0) outtextxy(25+40*j,55+10*i," "); else outtextxy(25+40*j,65+10*i,A[i][j]); // outtextxy(25+40*j,55+40*i,"1"); } } where A[][]is the array in which sudoku is stored and the blanks are inputed as "0"; now I am having this error : cannot convert 'int' into 'const char far*' Pls help

Member Avatar
Member Avatar
+0 forum 2

Newbie here, Final year student of Electronics, I am learning python and want to move in the direction of web development! sounds quite strange to the filed i am in. i have been geting interested in working with API's and learning frontend using tkinter in python. Thanks!

Member Avatar
Member Avatar
+0 forum 2

I have an assignment to create a card game that compares to dealt cards between players to see who has the highest valued card. It must first be determined by the cards value, then only if it is tied, the suits value. The code below is what I have so far. It is working, but it isnt how I need to compare the two cards together. string card(unsigned int card) //Assigns suits to values { if (card >= 52) { return "Invalid"; } return values[card % 13] + " of " + suits[card / 13]; // where card ranges from …

Member Avatar
+0 forum 0

I can't accomplish async and await in order to populate array and then show the end result. When I execute the code, firstly there is an empty array. When I go "refresh", then data is populated. Obviously async. But I don't know how to write the code The similar problem is described here https://community.apigee.com/questions/49199/nodejs-cache-retrieve-data-and-push-to-array.html My code so far const express = require('express'); const router = express.Router(); const db = require('../../config'); var async = require('async'); function readDb(nameOfTableInDb, someArray) { // reuse a conneciton to db db.getConnection(function (err, conn) { if (err) { res.json({ "code": 100, "status": "Error in connection DB..." }); …

Member Avatar
Member Avatar
+0 forum 2

I have a 2D array of characters (m x n) and i am trying to find all possible pattern that have a fixed length (example 5 characters) I have no clue how to start this if anyone could point me in the right direction that would be great!

Member Avatar
Member Avatar
+0 forum 5

I am trying to create a program can read marks of 10 student for different marks using **C program** but when I debug the output that shown was not the value that I input before, it keeps showing 7 digit value. Need someone advise, what is the misstake of my code. Below is my code. #include <stdio.h> int main() { int i, j; int marks[2][10]; printf("Enter the marks of the ten students :\n"); for(i=0;i<10;i++) { printf("\nEnter the marks of student :%d",i); printf("\nAssignment Mark :"); scanf("%d",marks[0]); printf("Exam Mark :"); scanf("%d",marks[1]); } printf("****************************************************************\n"); for(j=0;j<10;j++) { printf("Student No :%d\n",j); printf("Assignment Marks :%d\n",&marks[0]); printf("Exam …

Member Avatar
Member Avatar
+0 forum 2

currently working on a project for college. when searching coffee names from the array list , it will show the object but will also show "there is no coffee in the list" for every time the object doesn't match the search, how can I sort this out? public static void search () { boolean arrayName = false; if (numberOfCoffees > 0) { System.out.println ("search coffee"); System.out.println ("what are you searching for?"); String search = sc.nextLine(); for (int i = 0; i < numberOfCoffees; i++) { arrayName = coffee[i][0].equals (search); if (arrayName == true) { System.out.println("coffee found: " + coffee[i][0] + …

Member Avatar
Member Avatar
+0 forum 1

currently working on a project for college. when searching coffee names from the array list , it will only show the first object in the array list but when searching others, it says 'coffee not found' any help would be appreciated public static void search () { if (numberOfCoffees > 0) { System.out.println ("search coffee"); System.out.println ("what are you searching for?"); String search = sc.nextLine(); int i = 0; int o = 0; String arrayName = coffee[i][0]; if (arrayName.equals(search)){ System.out.println("found: " + coffee[i][0] + " £" + coffee[i][1] ); } else { System.out.println ("coffee not found"); } } else { …

Member Avatar
Member Avatar
+0 forum 1

//I want it to ask me for a number at first. Let's say I pass "5" and then type more numbers so I can add them as elements. And in final to make it show reversed elements. Thank u so much!

Member Avatar
Member Avatar
+0 forum 1

hi! I'm currently studying and having difficulty being able to print the array list, im not sure where im going wrong. any help will be appreciated import java.util.*; public class practice { static Scanner sc = new Scanner (System.in); static int numberOfCoffees = 0; static String[][] coffee = new String [50][2]; public static void main (String [] args) { int choice = 0; while (choice != 4) { menu (); choice = Integer.parseInt (sc.nextLine() ); if (choice == 1) { System.out.print('\u000C'); addItem(); } else if(choice == 2) { System.out.print('\u000C'); search(); } else if(choice == 3) { System.out.print('\u000C'); show(); } } …

Member Avatar
Member Avatar
+1 forum 1

Program 2 Shop application You must write a small application in JAVA that stores items and their prices. Your program must: 1. Create an array of item names. Use the following item names: Bread, Milk, Butter, Chips, Honey, Soap, Towel, Carrots, Beans, Samp, Dress, Pants, Shoes, Socks. 2. Create an array of item prices. Use the following item prices: 15.50, 12.00, 56.00, 20.00, 45.00, 7.00, 75.00, 8.00, 5.00, 12.00, 200.00, 150.00, 400.00, 25.00. 3. Print every item name and its corresponding price. See the sample output given. 4. Print the average price of all the items. 5. Find the price …

Member Avatar
Member Avatar
+0 forum 1

i have manage to insert my checkbox array data into database. the problem is when i check multiple checkbox only the first data in array is inserted in database. i need when i check multiple checkbox, all the data i have check insert into database.can someone help me? this is my php code: <?php include ('connect.php'); $cat = implode(',', $_POST['check']); if(isset($_POST['submit'])) { for($i=0; $i<count($cat);$i++) { $p_id =$_GET ['sitter']; $price = $_POST ['price']; $pickup_date =$_POST ['pickup_date']; $dropoff_date =$_POST ['dropoff_date']; $numdays = $_POST ['numdays']; $total =$_POST ['test']; $sql2 = "INSERT INTO cat_sitter(sitter_fk,cat_fk, price, date_in, date_out,total_day, total)VALUES ('$p_id','" . $cat[$i] . "','$price','$pickup_date','$dropoff_date','$numdays', '$total')" …

Member Avatar
Member Avatar
+0 forum 1

hello, I am trying to write a vb.net programme that reads data from a file and do a count for each column as shown in the format below and also write to an output file. i am able to do the count but i am unable to write the output base on the resturants & days. From what i have, i can only write the total sum from the array index. Here is the format of the file for better understanding and what i have done so far. Note; treat me as a newbie **File Format** is 001,1,5,6,21 001,1,5,6,21 001,1,5,6,21 …

Member Avatar
Member Avatar
+0 forum 1

Magento : Using app/design/frontend/default/theme/template/catalog/product/view.phtml how to display my text message on my selected products, workout : <?php $productId = '42150'; $product = Mage::getModel('catalog/product')->load($productId); if( $productId == '42150' ) { echo "Test"; } ?> if i wrong pls correct me.

Member Avatar
+0 forum 0

i need to read from file two array with two different type (string and intger) but when i wrote the c code to read the file : char ON[row][30]; int RA[row][clo]; int i; int j; FILE*infile; infile=fopen("rane.txt","r"); for(i=0; i<row; i++) { fscanf(infile,"%s",&ON[i]); for (i=1;i<row;i++) for(j=0; j<clo; j++) fscanf(infile,"%d",&RA[i][j]); } then when i whant it to print it print something like that : 4740024 -61223616 504492512 how i could solve this problem?

Member Avatar
Member Avatar
+0 forum 1

Input: grid[][] = {"axmy", "bgdf", "xeet", "raks"}; Output: Yes a x m y b g d f x e e t r a k s Input: grid[][] = {"axmy", "brdf", "xeet", "rass"}; Output : No The general idea of what output should be. I have already coded the grid: # include <stdio.h> # include <math.h> # include <stdlib.h> int x; int y; char grid [10] [10]; int z; int j; int main() { // declare array with alphabet char alphabet[26] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', …

Member Avatar
Member Avatar
+0 forum 14

HI All I am displaying 10 questions randomly , if user play quizz multiple times - i want to display updated score of the users's session. demo url is : http://telugumirchi.com/quiz/ **index.php** <?php session_start(); ?> <?php require 'config.php'; ?> <!DOCTYPE html> <html> <head> <title>ABCD COMPANY</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Bootstrap --> <link href="css/bootstrap.min.css" rel="stylesheet" media="screen"> <link href="css/style.css" rel="stylesheet" media="screen"> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="../../assets/js/html5shiv.js"></script> <script src="../../assets/js/respond.min.js"></script> <![endif]--> </head> <body> <header> <p class="text-center"> Welcome <?php if(!empty($_SESSION['name'])){echo $_SESSION['name'];}?> </p> </header> <div class="container"> <div class="row"> <div class="col-xs-14 …

Member Avatar
+0 forum 0

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool given in C:\Users\USER\Desktop\Final Year Project\XAMPP\htdocs\littleavenue\shop.php on line 320 <?PHP if(!isset($_GET['product_category'])){ if(!isset($_GET['category'])){ $per_page = 6; if(isset($_GET['page'])){ $page = $_GET['page']; } else { $page = 1; } $startfrom = ($page-1) * $per_page; $getproducts = " SELECT * FROM products OREDR BY 1 DESC LIMIT $startfrom, $per_page"; $runproducts = mysqli_query($connection,$getproducts); ////LINE 320 //// while($row = mysqli_fetch_array($runproducts)){ ////LINE 320//// $productid = $row['product_id']; $producttitle = $row['product_title']; $productprice = $row['product_price']; $productimgone = $row['product_img1']; echo "<div class='col-md-4 col-sm-6 center-responsive' > <div class='product' > <a href='productdetails.php?product_id=$productid' > <img src='admin/product_images/$proproductimgone' class='img-responsive' > </a> <div class='text'> <h3><a href='productdetails.php?product_id=$productid'>$producttitle</a></h3> <p class='price'>$ $productprice</p> …

Member Avatar
Member Avatar
+0 forum 1

Hi i am trying to fetch data from database into my dropdown menu in codeigniter, but havind error of 'undefined variable: unit_name' . this is my model file `public function get_unit_value() { $result = $this ->db ->select('id, unit_name') -> get('units') -> result_array(); $unit_name = array(); foreach($result as $r) { $unit_name[$r['id']] = $r['unit_name']; } $unit_name[''] = 'Select unit...'; return $unit_name; }` this is my controller `public function unit(){ $this->load->database(); $this->load->model('client_model'); $data['unit_name'] = $this ->client_model-> get_unit_value(); $this -> load -> view('add_quote', $data); }` this s my view file `<div class="panel panel-default"> <div class="panel-heading">The form</div> <div class="panel-body"> <!--dropdown input--> <?php echo form_dropdown('unit_name',$data['unit_name'], '', …

Member Avatar
Member Avatar
+0 forum 1

Can we work with 3D matrices in Pandas?

Member Avatar
Member Avatar
+0 forum 2

Hiya, looking for some help on this bit of code: def save(x,y,z): user=x yourinventory=y score=z allinvent=[] allscore=[] with open("Inventory.txt","r+")as inventory: for line in inventory: allinvent.append(line.strip().split(',')) allinvent.append("\n") for line in allinvent: if (line[0]==yourinventory): allinvent.append(yourinventory) allinvent.pop(line[0:8]) print(allinvent) break inventory.append(allinvent) inventory.close I'm currently working on saving things like inventory, and I'm not sure what I need to use instead of append as I keep getting this error. Traceback (most recent call last): File "\\file1\Student-homes\Intake15\15QuintonSA\My Documents\Year 10\Computer Science\.Adventure Quest v2\main file.py", line 192, in <module> save("pandatron03", invent, 8) File "\\file1\Student-homes\Intake15\15QuintonSA\My Documents\Year 10\Computer Science\.Adventure Quest v2\main file.py", line 19, in save inventory.append(allinvent) `AttributeError: '_io.TextIOWrapper' object …

Member Avatar
+0 forum 0

The End.